7
7
import java .util .Map ;
8
8
9
9
import io .quarkus .deployment .dev .ClassScanResult ;
10
+ import io .quarkus .dev .testing .results .TestResultInterface ;
11
+ import io .quarkus .dev .testing .results .TestRunResultsInterface ;
10
12
11
- public class TestRunResults {
13
+ public class TestRunResults implements TestRunResultsInterface {
12
14
13
15
/**
14
16
* The run id
@@ -28,7 +30,7 @@ public class TestRunResults {
28
30
private final long started ;
29
31
private final long completed ;
30
32
31
- private final Map <String , TestClassResult > results ;
33
+ private final Map <String , ? extends TestClassResult > results ;
32
34
private final Map <String , TestClassResult > currentFailing = new HashMap <>();
33
35
private final Map <String , TestClassResult > historicFailing = new HashMap <>();
34
36
private final Map <String , TestClassResult > currentPassing = new HashMap <>();
@@ -58,9 +60,9 @@ public TestRunResults(long id, ClassScanResult trigger, boolean full, long start
58
60
long currentFailedCount = 0 ;
59
61
long currentSkippedCount = 0 ;
60
62
for (Map .Entry <String , TestClassResult > i : results .entrySet ()) {
61
- passedCount += i .getValue ().getPassing ().stream ().filter (TestResult ::isTest ).count ();
62
- failedCount += i .getValue ().getFailing ().stream ().filter (TestResult ::isTest ).count ();
63
- skippedCount += i .getValue ().getSkipped ().stream ().filter (TestResult ::isTest ).count ();
63
+ passedCount += i .getValue ().getPassing ().stream ().filter (TestResultInterface ::isTest ).count ();
64
+ failedCount += i .getValue ().getFailing ().stream ().filter (TestResultInterface ::isTest ).count ();
65
+ skippedCount += i .getValue ().getSkipped ().stream ().filter (TestResultInterface ::isTest ).count ();
64
66
currentPassedCount += i .getValue ().getPassing ().stream ().filter (s -> s .isTest () && s .getRunId () == id ).count ();
65
67
currentFailedCount += i .getValue ().getFailing ().stream ().filter (s -> s .isTest () && s .getRunId () == id ).count ();
66
68
currentSkippedCount += i .getValue ().getSkipped ().stream ().filter (s -> s .isTest () && s .getRunId () == id ).count ();
@@ -98,6 +100,7 @@ public TestRunResults(long id, ClassScanResult trigger, boolean full, long start
98
100
this .currentSkippedCount = currentSkippedCount ;
99
101
}
100
102
103
+ @ Override
101
104
public long getId () {
102
105
return id ;
103
106
}
@@ -110,6 +113,7 @@ public boolean isFull() {
110
113
return full ;
111
114
}
112
115
116
+ @ Override
113
117
public Map <String , TestClassResult > getResults () {
114
118
return Collections .unmodifiableMap (results );
115
119
}
@@ -130,14 +134,17 @@ public Map<String, TestClassResult> getHistoricPassing() {
130
134
return historicPassing ;
131
135
}
132
136
137
+ @ Override
133
138
public long getStartedTime () {
134
139
return started ;
135
140
}
136
141
142
+ @ Override
137
143
public long getCompletedTime () {
138
144
return completed ;
139
145
}
140
146
147
+ @ Override
141
148
public long getTotalTime () {
142
149
return completed - started ;
143
150
}
@@ -154,34 +161,42 @@ public List<TestClassResult> getSkipped() {
154
161
return skipped ;
155
162
}
156
163
164
+ @ Override
157
165
public long getPassedCount () {
158
166
return passedCount ;
159
167
}
160
168
169
+ @ Override
161
170
public long getFailedCount () {
162
171
return failedCount ;
163
172
}
164
173
174
+ @ Override
165
175
public long getSkippedCount () {
166
176
return skippedCount ;
167
177
}
168
178
179
+ @ Override
169
180
public long getCurrentPassedCount () {
170
181
return currentPassedCount ;
171
182
}
172
183
184
+ @ Override
173
185
public long getCurrentFailedCount () {
174
186
return currentFailedCount ;
175
187
}
176
188
189
+ @ Override
177
190
public long getCurrentSkippedCount () {
178
191
return currentSkippedCount ;
179
192
}
180
193
194
+ @ Override
181
195
public long getTotalCount () {
182
196
return getPassedCount () + getFailedCount () + getSkippedCount ();
183
197
}
184
198
199
+ @ Override
185
200
public long getCurrentTotalCount () {
186
201
return getCurrentPassedCount () + getCurrentFailedCount () + getCurrentSkippedCount ();
187
202
}
0 commit comments