@@ -52,27 +52,6 @@ public void testPlanExecutionStarted(TestPlan testPlan) {
52
52
listener .testPlanExecutionStarted (testPlan );
53
53
}
54
54
55
- // compare to Junit4TestListener.testRunFinished
56
- @ Override
57
- public void testPlanExecutionFinished (TestPlan testPlan ) {
58
- // testStarted was called for latest test, but not the testFinished
59
- // report all failures as unbounded
60
- for (TestExecutionSummary .Failure failure : listener .getSummary ().getFailures ()) {
61
- long runtime = System .currentTimeMillis () - this .testPlanStartTime ;
62
- String className = testClass .getCanonicalName ();
63
- String methodName = testIdentifier .getDisplayName ().replace ("()" , "" );
64
- results .add (
65
- new TestResult (
66
- className ,
67
- methodName ,
68
- runtime ,
69
- ResultType .FAILURE ,
70
- failure .getException (),
71
- null ,
72
- null ));
73
- }
74
- }
75
-
76
55
// compare to Junit4TestListener.testIgnored
77
56
@ Override
78
57
public void executionSkipped (TestIdentifier testIdentifier , String reason ) {
@@ -150,16 +129,14 @@ public void executionFinished(TestIdentifier testIdentifier, TestExecutionResult
150
129
stdErrStream .flush ();
151
130
152
131
TestExecutionSummary summary = listener .getSummary ();
153
- long numFailures = summary .getTestsFailedCount ();
154
-
155
- TestExecutionSummary .Failure failure ;
156
- ResultType type ;
157
- if (numFailures == 0 ) {
158
- failure = null ;
159
- type = ResultType .SUCCESS ;
160
- } else {
161
- failure = summary .getFailures ().get (0 );
162
- type = ResultType .FAILURE ;
132
+ TestExecutionSummary .Failure failure = null ;
133
+ ResultType type = ResultType .SUCCESS ;
134
+ for (TestExecutionSummary .Failure f : summary .getFailures ()) {
135
+ if (f .getTestIdentifier ().equals (testIdentifier )) {
136
+ failure = f ;
137
+ type = ResultType .FAILURE ;
138
+ break ;
139
+ }
163
140
}
164
141
165
142
StringBuilder stdOut = new StringBuilder ();
0 commit comments