Skip to content
This repository
Browse code

Merge pull request #139 from paulbakker/test-reports

Fixes for junit test reports
  • Loading branch information...
commit d42429ee0742532916c3b94a0a5a6f3fc48394bf 2 parents be2c90c + d1a3d21
Peter Kriens authored March 16, 2012
14  biz.aQute.junit/src/aQute/junit/JunitXmlReport.java
@@ -17,6 +17,9 @@
17 17
 	long				startTime;
18 18
 	long				testStartTime;
19 19
 	int					tests		= 0;
  20
+	int					failures	= 0;
  21
+	int					errors		= 0;
  22
+	int					skipped     = 0;
20 23
 	PrintWriter			out;
21 24
 	boolean				finished;
22 25
 	boolean				progress;
@@ -122,6 +125,9 @@ public void end() {
122 125
 		if (!finished) {
123 126
 			finished = true;
124 127
 			testsuite.addAttribute("tests", tests);
  128
+			testsuite.addAttribute("failures", failures);
  129
+			testsuite.addAttribute("errors", errors);
  130
+			testsuite.addAttribute("skipped", skipped);
125 131
 			testsuite.addAttribute("time",
126 132
 					getFraction(System.currentTimeMillis() - startTime, 1000));
127 133
 			testsuite.addAttribute("timestamp", df.format(new Date()));
@@ -173,6 +179,8 @@ public void addError(Test test, Throwable t) {
173 179
 		else
174 180
 			testcase.addContent(error);
175 181
 		progress(" e");
  182
+		
  183
+		errors++;
176 184
 	}
177 185
 
178 186
 	private void progress(String s) {
@@ -206,17 +214,19 @@ public void addFailure(Test test, AssertionFailedError t) {
206 214
 		failure.addContent(getTrace(t));
207 215
 		testcase.addContent(failure);
208 216
 		progress(" f");
  217
+		
  218
+		failures++;
209 219
 	}
210 220
 
211 221
 	public void endTest(Test test) {
212 222
 		String[] outs = basic.getCaptured();
213 223
 		if (outs[0] != null) {
214  
-			Tag sysout = new Tag(testcase, "sys-out");
  224
+			Tag sysout = new Tag(testcase, "system-out");
215 225
 			sysout.addContent(outs[0]);
216 226
 		}
217 227
 
218 228
 		if (outs[1] != null) {
219  
-			Tag sysout = new Tag(testcase, "sys-err");
  229
+			Tag sysout = new Tag(testcase, "system-err");
220 230
 			sysout.addContent(outs[1]);
221 231
 		}
222 232
 

0 notes on commit d42429e

Please sign in to comment.
Something went wrong with that request. Please try again.