32
32
public class JUnit4RerunFailingTestsIT
33
33
extends SurefireJUnit4IntegrationTestCase
34
34
{
35
+ private static final String VERSION = "4.13.2" ;
36
+
35
37
private SurefireLauncher unpack ()
36
38
{
37
39
return unpack ( "/junit4-rerun-failing-tests" );
@@ -41,22 +43,22 @@ private SurefireLauncher unpack()
41
43
public void testRerunFailingErrorTestsWithOneRetry ()
42
44
{
43
45
OutputValidator outputValidator =
44
- unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( "4.13" ).maven ().addGoal (
46
+ unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( VERSION ).maven ().addGoal (
45
47
"-Dsurefire.rerunFailingTestsCount=1" ).withFailure ().executeTest ().assertTestSuiteResults ( 5 , 1 , 1 , 0 ,
46
48
0 );
47
49
verifyFailuresOneRetryAllClasses ( outputValidator );
48
50
49
- outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( "4.13" ).maven ().addGoal (
51
+ outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( VERSION ).maven ().addGoal (
50
52
"-Dsurefire.rerunFailingTestsCount=1" ).addGoal (
51
53
"-DforkCount=2" ).withFailure ().executeTest ().assertTestSuiteResults ( 5 , 1 , 1 , 0 , 0 );
52
54
verifyFailuresOneRetryAllClasses ( outputValidator );
53
55
54
- outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( "4.13" ).maven ().addGoal (
56
+ outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( VERSION ).maven ().addGoal (
55
57
"-Dsurefire.rerunFailingTestsCount=1" ).addGoal ( "-Dparallel=methods" ).addGoal (
56
58
"-DuseUnlimitedThreads=true" ).withFailure ().executeTest ().assertTestSuiteResults ( 5 , 1 , 1 , 0 , 0 );
57
59
verifyFailuresOneRetryAllClasses ( outputValidator );
58
60
59
- outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( "4.13" ).maven ().addGoal (
61
+ outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( VERSION ).maven ().addGoal (
60
62
"-Dsurefire.rerunFailingTestsCount=1" ).addGoal ( "-Dparallel=classes" ).addGoal (
61
63
"-DuseUnlimitedThreads=true" ).withFailure ().executeTest ().assertTestSuiteResults ( 5 , 1 , 1 , 0 , 0 );
62
64
verifyFailuresOneRetryAllClasses ( outputValidator );
@@ -67,24 +69,24 @@ public void testRerunFailingErrorTestsTwoRetry()
67
69
{
68
70
// Four flakes, both tests have been re-run twice
69
71
OutputValidator outputValidator =
70
- unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( "4.13" ).maven ().addGoal (
72
+ unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( VERSION ).maven ().addGoal (
71
73
"-Dsurefire.rerunFailingTestsCount=2" ).executeTest ().assertTestSuiteResults ( 5 , 0 , 0 , 0 , 4 );
72
74
73
75
verifyFailuresTwoRetryAllClasses ( outputValidator );
74
76
75
- outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( "4.13" ).maven ().addGoal (
77
+ outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( VERSION ).maven ().addGoal (
76
78
"-Dsurefire.rerunFailingTestsCount=2" ).addGoal ( "-DforkCount=3" ).executeTest ()
77
79
.assertTestSuiteResults ( 5 , 0 , 0 , 0 , 4 );
78
80
79
81
verifyFailuresTwoRetryAllClasses ( outputValidator );
80
82
81
- outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( "4.13" ).maven ().addGoal (
83
+ outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( VERSION ).maven ().addGoal (
82
84
"-Dsurefire.rerunFailingTestsCount=2" ).addGoal ( "-Dparallel=methods" ).addGoal (
83
85
"-DuseUnlimitedThreads=true" ).executeTest ().assertTestSuiteResults ( 5 , 0 , 0 , 0 , 4 );
84
86
85
87
verifyFailuresTwoRetryAllClasses ( outputValidator );
86
88
87
- outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( "4.13" ).maven ().addGoal (
89
+ outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( VERSION ).maven ().addGoal (
88
90
"-Dsurefire.rerunFailingTestsCount=2" ).addGoal ( "-Dparallel=classes" ).addGoal (
89
91
"-DuseUnlimitedThreads=true" ).executeTest ().assertTestSuiteResults ( 5 , 0 , 0 , 0 , 4 );
90
92
@@ -95,22 +97,22 @@ public void testRerunFailingErrorTestsTwoRetry()
95
97
public void testRerunFailingErrorTestsFalse ()
96
98
{
97
99
OutputValidator outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion (
98
- "4.13" ).maven ().withFailure ().executeTest ().assertTestSuiteResults ( 5 , 1 , 1 , 0 , 0 );
100
+ VERSION ).maven ().withFailure ().executeTest ().assertTestSuiteResults ( 5 , 1 , 1 , 0 , 0 );
99
101
100
102
verifyFailuresNoRetryAllClasses ( outputValidator );
101
103
102
- outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( "4.13" ).maven ().addGoal (
104
+ outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( VERSION ).maven ().addGoal (
103
105
"-DforkCount=3" ).withFailure ().executeTest ().assertTestSuiteResults ( 5 , 1 , 1 , 0 , 0 );
104
106
105
107
verifyFailuresNoRetryAllClasses ( outputValidator );
106
108
107
- outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( "4.13" ).maven ().addGoal (
109
+ outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( VERSION ).maven ().addGoal (
108
110
"-Dparallel=methods" ).addGoal (
109
111
"-DuseUnlimitedThreads=true" ).withFailure ().executeTest ().assertTestSuiteResults ( 5 , 1 , 1 , 0 , 0 );
110
112
111
113
verifyFailuresNoRetryAllClasses ( outputValidator );
112
114
113
- outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( "4.13" ).maven ().addGoal (
115
+ outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( VERSION ).maven ().addGoal (
114
116
"-Dparallel=classes" ).addGoal (
115
117
"-DuseUnlimitedThreads=true" ).withFailure ().executeTest ().assertTestSuiteResults ( 5 , 1 , 1 , 0 , 0 );
116
118
@@ -121,26 +123,26 @@ public void testRerunFailingErrorTestsFalse()
121
123
public void testRerunOneTestClass ()
122
124
{
123
125
OutputValidator outputValidator =
124
- unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( "4.13" ).maven ().addGoal (
126
+ unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( VERSION ).maven ().addGoal (
125
127
"-Dsurefire.rerunFailingTestsCount=1" ).addGoal (
126
128
"-Dtest=FlakyFirstTimeTest" ).withFailure ().executeTest ().assertTestSuiteResults ( 3 , 1 , 1 , 0 , 0 );
127
129
128
130
verifyFailuresOneRetryOneClass ( outputValidator );
129
131
130
- outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( "4.13" ).maven ().addGoal (
132
+ outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( VERSION ).maven ().addGoal (
131
133
"-Dsurefire.rerunFailingTestsCount=1" ).addGoal ( "-DforkCount=3" ).addGoal (
132
134
"-Dtest=FlakyFirstTimeTest" ).withFailure ().executeTest ().assertTestSuiteResults ( 3 , 1 , 1 , 0 , 0 );
133
135
134
136
verifyFailuresOneRetryOneClass ( outputValidator );
135
137
136
- outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( "4.13" ).maven ().addGoal (
138
+ outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( VERSION ).maven ().addGoal (
137
139
"-Dsurefire.rerunFailingTestsCount=1" ).addGoal ( "-Dparallel=methods" ).addGoal (
138
140
"-DuseUnlimitedThreads=true" ).addGoal (
139
141
"-Dtest=FlakyFirstTimeTest" ).withFailure ().executeTest ().assertTestSuiteResults ( 3 , 1 , 1 , 0 , 0 );
140
142
141
143
verifyFailuresOneRetryOneClass ( outputValidator );
142
144
143
- outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( "4.13" ).maven ().addGoal (
145
+ outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( VERSION ).maven ().addGoal (
144
146
"-Dsurefire.rerunFailingTestsCount=1" ).addGoal ( "-Dparallel=classes" ).addGoal (
145
147
"-DuseUnlimitedThreads=true" ).addGoal (
146
148
"-Dtest=FlakyFirstTimeTest" ).withFailure ().executeTest ().assertTestSuiteResults ( 3 , 1 , 1 , 0 , 0 );
@@ -152,29 +154,29 @@ public void testRerunOneTestClass()
152
154
public void testRerunOneTestMethod ()
153
155
{
154
156
OutputValidator outputValidator =
155
- unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( "4.13" ).maven ().addGoal (
157
+ unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( VERSION ).maven ().addGoal (
156
158
"-Dsurefire.rerunFailingTestsCount=1" ).addGoal (
157
159
"-Dtest=FlakyFirstTimeTest#testFailing*" ).withFailure ().executeTest ().assertTestSuiteResults ( 1 , 0 , 1 ,
158
160
0 , 0 );
159
161
160
162
verifyFailuresOneRetryOneMethod ( outputValidator );
161
163
162
- outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( "4.13" ).maven ().addGoal (
164
+ outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( VERSION ).maven ().addGoal (
163
165
"-Dsurefire.rerunFailingTestsCount=1" ).addGoal ( "-DforkCount=3" ).addGoal (
164
166
"-Dtest=FlakyFirstTimeTest#testFailing*" ).withFailure ().executeTest ().assertTestSuiteResults ( 1 , 0 , 1 , 0 ,
165
167
0 );
166
168
167
169
verifyFailuresOneRetryOneMethod ( outputValidator );
168
170
169
- outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( "4.13" ).maven ().addGoal (
171
+ outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( VERSION ).maven ().addGoal (
170
172
"-Dsurefire.rerunFailingTestsCount=1" ).addGoal ( "-Dparallel=methods" ).addGoal (
171
173
"-DuseUnlimitedThreads=true" ).addGoal (
172
174
"-Dtest=FlakyFirstTimeTest#testFailing*" ).withFailure ().executeTest ().assertTestSuiteResults ( 1 , 0 , 1 , 0 ,
173
175
0 );
174
176
175
177
verifyFailuresOneRetryOneMethod ( outputValidator );
176
178
177
- outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( "4.13" ).maven ().addGoal (
179
+ outputValidator = unpack ().addGoal ( "-Dprovider=surefire-junit4" ).setJUnitVersion ( VERSION ).maven ().addGoal (
178
180
"-Dsurefire.rerunFailingTestsCount=1" ).addGoal ( "-Dparallel=classes" ).addGoal (
179
181
"-DuseUnlimitedThreads=true" ).addGoal (
180
182
"-Dtest=FlakyFirstTimeTest#testFailing*" ).withFailure ().executeTest ().assertTestSuiteResults ( 1 , 0 , 1 , 0 ,
0 commit comments