@@ -118,36 +118,36 @@ public class PlainJUnitResultFormatter implements JUnitResultFormatter, IgnoredT
*/
*/
public void endTestSuite(JUnitTest suite) throws BuildException {
public void endTestSuite(JUnitTest suite) throws BuildException {
try {
try {
StringBuffer sb = new StringBuffer("Tests run: ");
sb.append(suite.runCount());
sb.append(", Failures: ");
sb.append(suite.failureCount());
sb.append(", Errors: ");
sb.append(suite.errorCount());
sb.append(", Skipped: ");
sb.append(suite.skipCount());
sb.append(", Time elapsed: ");
sb.append(nf.format(suite.getRunTime() / ONE_SECOND));
sb.append(" sec");
sb.append(StringUtils.LINE_SEP);
StringBuffer sb = new StringBuffer("Tests run: ");
sb.append(suite.runCount());
sb.append(", Failures: ");
sb.append(suite.failureCount());
sb.append(", Errors: ");
sb.append(suite.errorCount());
sb.append(", Skipped: ");
sb.append(suite.skipCount());
sb.append(", Time elapsed: ");
sb.append(nf.format(suite.getRunTime() / ONE_SECOND));
sb.append(" sec");
sb.append(StringUtils.LINE_SEP);
write(sb.toString());
write(sb.toString());
// write the err and output streams to the log
if (systemOutput != null && systemOutput.length() > 0) {
// write the err and output streams to the log
if (systemOutput != null && systemOutput.length() > 0) {
write("------------- Standard Output ---------------");
write("------------- Standard Output ---------------");
write(StringUtils.LINE_SEP);
write(StringUtils.LINE_SEP);
write(systemOutput);
write(systemOutput);
write("------------- ---------------- ---------------");
write("------------- ---------------- ---------------");
write(StringUtils.LINE_SEP);
write(StringUtils.LINE_SEP);
}
}
if (systemError != null && systemError.length() > 0) {
if (systemError != null && systemError.length() > 0) {
write("------------- Standard Error -----------------");
write("------------- Standard Error -----------------");
write(StringUtils.LINE_SEP);
write(StringUtils.LINE_SEP);
write(systemError);
write(systemError);
write("------------- ---------------- ---------------");
write("------------- ---------------- ---------------");
write(StringUtils.LINE_SEP);
write(StringUtils.LINE_SEP);
}
}
write(StringUtils.LINE_SEP);
write(StringUtils.LINE_SEP);
if (out != null) {
if (out != null) {
@@ -159,20 +159,20 @@ public class PlainJUnitResultFormatter implements JUnitResultFormatter, IgnoredT
}
}
}
}
} finally {
} finally {
if (out != null) {
try {
wri.close();
} catch (IOException ioex) {
if (out != null) {
try {
wri.close();
} catch (IOException ioex) {
throw new BuildException("Unable to flush output", ioex);
throw new BuildException("Unable to flush output", ioex);
} finally {
if (out != System.out && out != System.err) {
FileUtils.close(out);
}
} finally {
if (out != System.out && out != System.err) {
FileUtils.close(out);
}
wri = null;
wri = null;
out = null;
out = null;
}
}
}
}
}
}
}
}
/**
/**