Skip to content

Commit 2d92f2d

Browse files
slachiewiczmichael-o
authored andcommitted
[SUREFIRE-2231] JaCoCo 0.8.11 fails with old TestNG releases on Java 17+
This closes #710
1 parent 3290740 commit 2d92f2d

File tree

3 files changed

+10
-110
lines changed

3 files changed

+10
-110
lines changed

pom.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@
9696
<!-- Do not upgrade, leads to test failures, MSHARED-1014 -->
9797
<mavenSharedUtilsVersion>3.3.4</mavenSharedUtilsVersion>
9898
<powermockVersion>2.0.9</powermockVersion>
99-
<!-- Do not upgrade, leads to test failures -->
100-
<jacocoVersion>0.8.8</jacocoVersion>
99+
<jacocoVersion>0.8.11</jacocoVersion>
101100
<testngVersion>5.11</testngVersion>
102101
<surefire-shared-utils.version>${project.version}</surefire-shared-utils.version>
103102
<maven.surefire.scm.devConnection>scm:git:https://gitbox.apache.org/repos/asf/maven-surefire.git</maven.surefire.scm.devConnection>

surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgVersionsIT.java

+9-91
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.apache.maven.surefire.its.fixture.OutputValidator;
2626
import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
2727
import org.apache.maven.surefire.its.fixture.SurefireLauncher;
28-
import org.junit.Ignore;
2928
import org.junit.Test;
3029

3130
import static org.junit.Assert.assertEquals;
@@ -41,106 +40,25 @@
4140
*/
4241
public class CheckTestNgVersionsIT extends SurefireJUnit4IntegrationTestCase {
4342

43+
// TestNG 7.6 and above needs JDK11
4444
@Test
45-
public void test47() {
46-
runTestNgTest("4.7", "jdk15");
45+
public void test751() {
46+
runTestNgTestWithRunOrder("7.5.1");
4747
}
4848

4949
@Test
50-
@Ignore("5.0 and 5.0.1 jars on central are malformed SUREFIRE-375 + MAVENUPLOAD-1024")
51-
public void xXXtest50() {
52-
runTestNgTest("5.0", "jdk15");
50+
public void test6143() {
51+
runTestNgTestWithRunOrder("6.14.3");
5352
}
5453

5554
@Test
56-
@Ignore("5.0 and 5.0.1 jars on central are malformed SUREFIRE-375 + MAVENUPLOAD-1024")
57-
public void xXXtest501() {
58-
runTestNgTest("5.0.1", "jdk15");
55+
public void test69136() {
56+
runTestNgTestWithRunOrder("6.9.13.6");
5957
}
6058

6159
@Test
62-
public void test502() {
63-
runTestNgTest("5.0.2", "jdk15");
64-
}
65-
66-
@Test
67-
public void test51() {
68-
runTestNgTest("5.1", "jdk15");
69-
}
70-
71-
@Test
72-
public void test55() {
73-
runTestNgTest("5.5", "jdk15");
74-
}
75-
76-
@Test
77-
public void test56() {
78-
runTestNgTest("5.6", "jdk15");
79-
}
80-
81-
@Test
82-
public void test57() {
83-
runTestNgTest("5.7", "jdk15");
84-
}
85-
86-
@Test
87-
public void test58() {
88-
runTestNgTest("5.8", "jdk15");
89-
}
90-
91-
@Test
92-
public void test59() {
93-
runTestNgTest("5.9", "jdk15");
94-
}
95-
96-
@Test
97-
public void test510() {
98-
runTestNgTest("5.10", "jdk15");
99-
}
100-
101-
@Test
102-
public void test511() {
103-
runTestNgTest("5.11", "jdk15");
104-
}
105-
106-
@Test
107-
public void test512() {
108-
runTestNgTest("5.12.1");
109-
}
110-
111-
@Test
112-
public void test513() {
113-
runTestNgTest("5.13");
114-
}
115-
116-
@Test
117-
public void test5131() {
118-
runTestNgTest("5.13.1");
119-
}
120-
121-
@Test
122-
public void test514() {
123-
runTestNgTest("5.14");
124-
}
125-
126-
@Test
127-
public void test5141() {
128-
runTestNgTest("5.14.1");
129-
}
130-
131-
@Test
132-
public void test5142() {
133-
runTestNgTest("5.14.2");
134-
}
135-
136-
@Test
137-
public void test60() {
138-
runTestNgTest("6.0");
139-
}
140-
141-
@Test
142-
public void test685() {
143-
runTestNgTestWithRunOrder("6.8.5");
60+
public void test6821() {
61+
runTestNgTestWithRunOrder("6.8.21");
14462
}
14563

14664
private void runTestNgTestWithRunOrder(String version) {

surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1967CheckTestNgMethodParallelOrderingIT.java

-17
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
2222
import org.junit.Test;
2323

24-
import static org.apache.maven.surefire.its.fixture.HelperAssertions.assumeJavaMaxVersion;
25-
2624
/**
2725
* Test TestNG setup and teardown ordering with parallelism
2826
*
@@ -58,19 +56,4 @@ public void testNgParallelOrderingWithEarlyVersion6() {
5856
.executeTest()
5957
.verifyErrorFree(12);
6058
}
61-
62-
// TestNG 5.13+ already has XmlClass.m_index field, but doesn't have XmlClass.setIndex method.
63-
// Note that the problem of wrong setup methods ordering (SUREFIRE-1967) was not observed on that version.
64-
// This is likely because SUREFIRE-1967 is related to a change in TestNG 6.3, where preserve-order became true by
65-
// default (https://github.com/cbeust/testng/commit/8849b3406ef2184ceb6002768a2d087d7a8de8d5).
66-
@Test
67-
public void testNgParallelOrderingWithVersion5() {
68-
// TestNG 5.13 does not work with Java 17
69-
assumeJavaMaxVersion(16);
70-
71-
unpack("surefire-1967-testng-method-parallel-ordering")
72-
.sysProp("testNgVersion", "5.13")
73-
.executeTest()
74-
.verifyErrorFree(12);
75-
}
7659
}

0 commit comments

Comments
 (0)