10
10
import org .testng .annotations .DataProvider ;
11
11
import org .testng .annotations .Test ;
12
12
import org .testng .xml .XmlSuite ;
13
+ import test .configurationfailurepolicy .issue2731 .ConfigFailTestSample ;
13
14
import testhelper .OutputDirectoryPatch ;
14
15
15
16
public class FailurePolicyTest {
@@ -26,32 +27,33 @@ public void setupClass(ITestContext testContext) {
26
27
public Object [][] getData () {
27
28
return new Object [][] {
28
29
// params - confFail, confSkip, skippedTests
29
- new Object [] {new Class [] {ClassWithFailedBeforeClassMethod .class }, 1 , 1 , 1 },
30
- new Object [] {new Class [] {ClassWithFailedBeforeClassMethodAndAfterClass .class }, 1 , 1 , 1 },
31
- new Object [] {new Class [] {ClassWithFailedBeforeMethodAndMultipleTests .class }, 2 , 0 , 2 },
30
+ new Object [] {new Class [] {ClassWithFailedBeforeClassMethod .class }, 1 , 0 , 0 },
31
+ new Object [] {new Class [] {ClassWithFailedBeforeClassMethodAndAfterClass .class }, 1 , 0 , 0 },
32
+ new Object [] {new Class [] {ClassWithFailedBeforeMethodAndMultipleTests .class }, 2 , 0 , 0 },
32
33
new Object [] {
33
34
new Class [] {ClassWithFailedBeforeClassMethodAndBeforeMethodAfterMethodAfterClass .class },
34
35
1 ,
35
- 3 ,
36
- 1
36
+ 0 ,
37
+ 0
37
38
},
38
- new Object [] {new Class [] {ClassWithFailedBeforeMethodAndMultipleInvocations .class }, 4 , 0 , 4 },
39
- new Object [] {new Class [] {ExtendsClassWithFailedBeforeMethod .class }, 2 , 2 , 2 },
40
- new Object [] {new Class [] {ExtendsClassWithFailedBeforeClassMethod .class }, 1 , 2 , 2 },
39
+ new Object [] {new Class [] {ClassWithFailedBeforeMethodAndMultipleInvocations .class }, 4 , 0 , 0 },
40
+ new Object [] {new Class [] {ExtendsClassWithFailedBeforeMethod .class }, 2 , 0 , 0 },
41
+ new Object [] {new Class [] {ExtendsClassWithFailedBeforeClassMethod .class }, 1 , 0 , 0 },
41
42
new Object [] {
42
43
new Class [] {
43
44
ClassWithFailedBeforeClassMethod .class , ExtendsClassWithFailedBeforeClassMethod .class
44
45
},
45
46
2 ,
46
- 3 ,
47
- 3
47
+ 0 ,
48
+ 0
48
49
},
49
- new Object [] {new Class [] {ClassWithSkippingBeforeMethod .class }, 0 , 1 , 1 },
50
- new Object [] {new Class [] {FactoryClassWithFailedBeforeMethod .class }, 2 , 0 , 2 },
50
+ new Object [] {new Class [] {ClassWithSkippingBeforeMethod .class }, 0 , 1 , 0 },
51
+ new Object [] {new Class [] {FactoryClassWithFailedBeforeMethod .class }, 2 , 0 , 0 },
51
52
new Object [] {
52
- new Class [] {FactoryClassWithFailedBeforeMethodAndMultipleInvocations .class }, 8 , 0 , 8
53
+ new Class [] {FactoryClassWithFailedBeforeMethodAndMultipleInvocations .class }, 8 , 0 , 0
53
54
},
54
- new Object [] {new Class [] {FactoryClassWithFailedBeforeClassMethod .class }, 2 , 2 , 2 },
55
+ new Object [] {new Class [] {FactoryClassWithFailedBeforeClassMethod .class }, 2 , 0 , 0 },
56
+ new Object [] {new Class [] {ConfigFailTestSample .class }, 4 , 0 , 0 }
55
57
};
56
58
}
57
59
@@ -86,7 +88,7 @@ public void confFailureTestInvolvingGroups() {
86
88
testng .setConfigFailurePolicy (XmlSuite .FailurePolicy .CONTINUE );
87
89
testng .setGroups ("group1" );
88
90
testng .run ();
89
- verify (tla , 1 , 3 , 1 );
91
+ verify (tla , 1 , 0 , 0 );
90
92
}
91
93
92
94
@ Test
@@ -124,7 +126,7 @@ public void commandLineTest_policyAsContinue() {
124
126
TestListenerAdapter tla = new TestListenerAdapter ();
125
127
TestNG .privateMain (argv , tla );
126
128
127
- verify (tla , 2 , 0 , 2 );
129
+ verify (tla , 2 , 0 , 0 );
128
130
}
129
131
130
132
@ Test
@@ -160,7 +162,7 @@ public void commandLineTestWithXMLFile_policyAsContinue() {
160
162
TestListenerAdapter tla = new TestListenerAdapter ();
161
163
TestNG .privateMain (argv , tla );
162
164
163
- verify (tla , 2 , 0 , 2 );
165
+ verify (tla , 2 , 0 , 0 );
164
166
}
165
167
166
168
private void verify (
0 commit comments