Skip to content

Commit

Permalink
[SUREFIRE-2231] JaCoCo 0.8.11 fails with old TestNG releases on Java 17+
Browse files Browse the repository at this point in the history
This closes #710
  • Loading branch information
slachiewicz authored and michael-o committed Jan 5, 2024
1 parent 3290740 commit 2d92f2d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 110 deletions.
3 changes: 1 addition & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@
<!-- Do not upgrade, leads to test failures, MSHARED-1014 -->
<mavenSharedUtilsVersion>3.3.4</mavenSharedUtilsVersion>
<powermockVersion>2.0.9</powermockVersion>
<!-- Do not upgrade, leads to test failures -->
<jacocoVersion>0.8.8</jacocoVersion>
<jacocoVersion>0.8.11</jacocoVersion>
<testngVersion>5.11</testngVersion>
<surefire-shared-utils.version>${project.version}</surefire-shared-utils.version>
<maven.surefire.scm.devConnection>scm:git:https://gitbox.apache.org/repos/asf/maven-surefire.git</maven.surefire.scm.devConnection>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.apache.maven.surefire.its.fixture.OutputValidator;
import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.apache.maven.surefire.its.fixture.SurefireLauncher;
import org.junit.Ignore;
import org.junit.Test;

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

// TestNG 7.6 and above needs JDK11
@Test
public void test47() {
runTestNgTest("4.7", "jdk15");
public void test751() {
runTestNgTestWithRunOrder("7.5.1");
}

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

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

@Test
public void test502() {
runTestNgTest("5.0.2", "jdk15");
}

@Test
public void test51() {
runTestNgTest("5.1", "jdk15");
}

@Test
public void test55() {
runTestNgTest("5.5", "jdk15");
}

@Test
public void test56() {
runTestNgTest("5.6", "jdk15");
}

@Test
public void test57() {
runTestNgTest("5.7", "jdk15");
}

@Test
public void test58() {
runTestNgTest("5.8", "jdk15");
}

@Test
public void test59() {
runTestNgTest("5.9", "jdk15");
}

@Test
public void test510() {
runTestNgTest("5.10", "jdk15");
}

@Test
public void test511() {
runTestNgTest("5.11", "jdk15");
}

@Test
public void test512() {
runTestNgTest("5.12.1");
}

@Test
public void test513() {
runTestNgTest("5.13");
}

@Test
public void test5131() {
runTestNgTest("5.13.1");
}

@Test
public void test514() {
runTestNgTest("5.14");
}

@Test
public void test5141() {
runTestNgTest("5.14.1");
}

@Test
public void test5142() {
runTestNgTest("5.14.2");
}

@Test
public void test60() {
runTestNgTest("6.0");
}

@Test
public void test685() {
runTestNgTestWithRunOrder("6.8.5");
public void test6821() {
runTestNgTestWithRunOrder("6.8.21");
}

private void runTestNgTestWithRunOrder(String version) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.junit.Test;

import static org.apache.maven.surefire.its.fixture.HelperAssertions.assumeJavaMaxVersion;

/**
* Test TestNG setup and teardown ordering with parallelism
*
Expand Down Expand Up @@ -58,19 +56,4 @@ public void testNgParallelOrderingWithEarlyVersion6() {
.executeTest()
.verifyErrorFree(12);
}

// TestNG 5.13+ already has XmlClass.m_index field, but doesn't have XmlClass.setIndex method.
// Note that the problem of wrong setup methods ordering (SUREFIRE-1967) was not observed on that version.
// This is likely because SUREFIRE-1967 is related to a change in TestNG 6.3, where preserve-order became true by
// default (https://github.com/cbeust/testng/commit/8849b3406ef2184ceb6002768a2d087d7a8de8d5).
@Test
public void testNgParallelOrderingWithVersion5() {
// TestNG 5.13 does not work with Java 17
assumeJavaMaxVersion(16);

unpack("surefire-1967-testng-method-parallel-ordering")
.sysProp("testNgVersion", "5.13")
.executeTest()
.verifyErrorFree(12);
}
}

0 comments on commit 2d92f2d

Please sign in to comment.