You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Closes#3111
TestNG now exposes the IParameterInfo interface
Via which you can extract the following details
Pertaining to a factory powered test.
* the index - which would match with what was
Specified in the “indices” attribute of the “Factory”
Annotation. If nothing was specified, then this
Would be equal to a running count on the total instances.
* current index - which represents a running count
On the total instances.
* The parameters of the factory method
* The instance that was produced.
@@ -22,7 +33,9 @@ public void testExceptionWithNonStaticFactoryMethod() {
22
33
} catch (TestNGExceptione) {
23
34
assertThat(e)
24
35
.hasMessage(
25
-
"\nCan't invoke public java.lang.Object[] test.factory.GitHub876Sample.createInstances(): either make it static or add a no-args constructor to your class");
36
+
"\nCan't invoke public java.lang.Object[] test.factory.GitHub876Sample"
37
+
+ ".createInstances(): either make it static or add a no-args constructor to "
38
+
+ "your class");
26
39
}
27
40
}
28
41
@@ -46,7 +59,8 @@ public void testExceptionWithBadFactoryMethodReturnType() {
46
59
} catch (TestNGExceptione) {
47
60
assertThat(e)
48
61
.hasMessage(
49
-
"\ntest.factory.BadMethodReturnTypeFactory.createInstances MUST return [ java.lang.Object[] or org.testng.IInstanceInfo[] ] but returns java.lang.Object");
62
+
"\ntest.factory.BadMethodReturnTypeFactory.createInstances MUST return [ java.lang"
63
+
+ ".Object[] or org.testng.IInstanceInfo[] ] but returns java.lang.Object");
50
64
}
51
65
}
52
66
@@ -65,4 +79,31 @@ public void doubleFactoryMethodShouldWork() {
0 commit comments