Created
September 24, 2009 23:59
-
-
Save xeolabs/193152 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void runJsUnitInRhino(String entryPoint) { | |
//... | |
int result = proc.waitFor(); | |
if (result != 0) { | |
throw new JSExecutionException(getStdError(proc)); | |
} | |
} | |
private static String getStdError(Process proc) throws IOException { | |
StringBuilder sb = new StringBuilder(); | |
final BufferedReader reader = new BufferedReader(new InputStreamReader(proc.getErrorStream())); | |
String lineResult = null; | |
while ((lineResult = reader.readLine()) != null) { | |
sb.append(lineResult); | |
} | |
return sb.toString(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment