1 | StringBuffer sb = new StringBuffer("Tests run: ");↵ | | 1 | StringBuffer sb = new StringBuffer("Tests run: ");↵
|
2 | sb.append(suite.runCount());↵ | | 2 | sb.append(suite.runCount());↵
|
3 | sb.append(", Failures: ");↵ | | 3 | sb.append(", Failures: ");↵
|
4 | sb.append(suite.failureCount());↵ | | 4 | sb.append(suite.failureCount());↵
|
5 | sb.append(", Errors: ");↵ | | 5 | sb.append(", Errors: ");↵
|
6 | sb.append(suite.errorCount());↵ | | 6 | sb.append(suite.errorCount());↵
|
7 | sb.append(", Time elapsed: ");↵ | | 7 | sb.append(", Time elapsed: ");↵
|
8 | sb.append(nf.format(suite.getRunTime() / 1000.0));↵ | | 8 | sb.append(numberFormat.format(suite.getRunTime() / 1000.0));↵
|
9 | sb.append(" sec");↵ | | 9 | sb.append(" sec");↵
|
10 | sb.append(StringUtils.LINE_SEP);↵ | | 10 | sb.append(StringUtils.LINE_SEP);↵
|
| | | 11 | sb.append(StringUtils.LINE_SEP);↵
|
|
11 | // append the err and output streams to the log↵ | | 12 | // append the err and output streams to the log↵
|
12 | if (systemOutput != null && systemOutput.length() > 0) {↵ | | 13 | if (systemOutput != null && systemOutput.length() > 0) {↵
|
13 | sb.append("------------- Standard Output ---------------")↵ | | 14 | sb.append("------------- Standard Output ---------------")↵
|
14 | .append(StringUtils.LINE_SEP)↵ | | 15 | .append(StringUtils.LINE_SEP)↵
|
15 | .append(systemOutput)↵ | | 16 | .append(systemOutput)↵
|
16 | .append("------------- ---------------- ---------------")↵ | | 17 | .append("------------- ---------------- ---------------")↵
|
17 | .append(StringUtils.LINE_SEP);↵ | | 18 | .append(StringUtils.LINE_SEP);↵
|
18 | }↵ | | 19 | }↵
|
|
19 | if (systemError != null && systemError.length() > 0) {↵ | | 20 | if (systemError != null && systemError.length() > 0) {↵
|
20 | sb.append("------------- Standard Error -----------------")↵ | | 21 | sb.append("------------- Standard Error -----------------")↵
|
21 | .append(StringUtils.LINE_SEP)↵ | | 22 | .append(StringUtils.LINE_SEP)↵
|
22 | .append(systemError)↵ | | 23 | .append(systemError)↵
|
23 | .append("------------- ---------------- ---------------")↵ | | 24 | .append("------------- ---------------- ---------------")↵
|
24 | .append(StringUtils.LINE_SEP);↵ | | 25 | .append(StringUtils.LINE_SEP);↵
|
25 | }↵ | | 26 | }↵
|
|
26 | sb.append(StringUtils.LINE_SEP);↵ | | |
|
|
27 | if (out != null) {↵ | | 27 | if (output != null) {↵
|
28 | try {↵ | | 28 | try {↵
|
29 | out.write(sb.toString().getBytes());↵ | | 29 | output.write(sb.toString());↵
|
30 | wri.close();↵ | | 30 | resultWriter.close();↵
|
31 | out.write(inner.toString().getBytes());↵ | | 31 | output.write(results.toString());↵
|
32 | out.flush();↵ | | 32 | output.flush();↵
|
33 | } catch (IOException ioex) {↵ | | |
|
34 | throw new BuildException("Unable to write output", ioex);↵ | | |
|
35 | } finally {↵ | | 33 | } finally {↵
|
36 | if (out != System.out && out != System.err) {↵ | | 34 | if (out != System.out && out != System.err) {↵
|
37 | FileUtils.close(out);↵ | | 35 | FileUtils.close(out);↵
|
38 | }↵ | | 36 | }↵
|
39 | }↵ | | 37 | }↵
|
40 | } | | 38 | }
|