13
13
import org .testng .IDataProviderInterceptor ;
14
14
import org .testng .IDataProviderListener ;
15
15
import org .testng .IInstanceInfo ;
16
+ import org .testng .ITestClassInstance ;
16
17
import org .testng .ITestContext ;
17
18
import org .testng .ITestMethodFinder ;
18
19
import org .testng .ITestNGListener ;
@@ -145,8 +146,8 @@ private static String[] getAllGroups(
145
146
return groups .toArray (new String [0 ]);
146
147
}
147
148
148
- public org . testng . IParameterInfo [] invoke () {
149
- List <org . testng . IParameterInfo > result = Lists .newArrayList ();
149
+ public ITestClassInstance [] invoke () {
150
+ List <ITestClassInstance > result = Lists .newArrayList ();
150
151
151
152
Map <String , String > allParameterNames = Maps .newHashMap ();
152
153
Parameters .MethodParameters methodParameters =
@@ -175,7 +176,7 @@ public org.testng.IParameterInfo[] invoke() {
175
176
try {
176
177
List <Integer > indices = factoryAnnotation .getIndices ();
177
178
int position = 0 ;
178
- AtomicInteger counter = new AtomicInteger (0 );
179
+ AtomicInteger invocationCounter = new AtomicInteger (0 );
179
180
while (parameterIterator .hasNext ()) {
180
181
Object [] parameters = parameterIterator .next ();
181
182
if (parameters == null ) {
@@ -201,15 +202,15 @@ public org.testng.IParameterInfo[] invoke() {
201
202
.map (
202
203
instance ->
203
204
new ParameterInfo (
204
- instance , instancePosition , parameters , counter .getAndIncrement ()))
205
+ instance , instancePosition , parameters , invocationCounter .getAndIncrement ()))
205
206
.collect (Collectors .toList ()));
206
207
} else {
207
208
for (Integer index : indices ) {
208
209
int i = index - position ;
209
210
if (i >= 0 && i < testInstances .length ) {
210
211
result .add (
211
212
new ParameterInfo (
212
- testInstances [i ], position , parameters , counter .getAndIncrement ()));
213
+ testInstances [i ], position , parameters , invocationCounter .getAndIncrement ()));
213
214
}
214
215
}
215
216
}
@@ -218,7 +219,7 @@ public org.testng.IParameterInfo[] invoke() {
218
219
if (indices == null || indices .isEmpty () || indices .contains (position )) {
219
220
Object instance = m_objectFactory .newInstance (com .getConstructor (), parameters );
220
221
result .add (
221
- new ParameterInfo (instance , position , parameters , counter .getAndIncrement ()));
222
+ new ParameterInfo (instance , position , parameters , invocationCounter .getAndIncrement ()));
222
223
}
223
224
position ++;
224
225
}
0 commit comments