From 49ca7c8ed4a6b3555c8e7e0f81a9c6bc2c825628 Mon Sep 17 00:00:00 2001 From: Kristian Scheibe Date: Thu, 24 Oct 2019 08:47:20 +0200 Subject: [PATCH] Bump the TestNG version to 6.9.10 and force the use of TestNG.addListener(ITestNGListener). TestNG 7.0.0 removed various deprecated specialized TestNG.addListener methods. Using TestNG.addListener(ITestNGListener) explicitly keeps PITest binary-compatible with the new TestNG 7.x releases. --- .../src/test/resources/pit-testng-jmockit/pom.xml | 2 +- .../src/test/resources/pit-testng/pom.xml | 2 +- pitest/src/main/java/org/pitest/testng/TestNGTestUnit.java | 6 ++++-- pom.xml | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pitest-maven-verification/src/test/resources/pit-testng-jmockit/pom.xml b/pitest-maven-verification/src/test/resources/pit-testng-jmockit/pom.xml index 2b77b4258..5afa36cff 100644 --- a/pitest-maven-verification/src/test/resources/pit-testng-jmockit/pom.xml +++ b/pitest-maven-verification/src/test/resources/pit-testng-jmockit/pom.xml @@ -16,7 +16,7 @@ org.testng testng - 6.8.8 + 6.9.10 test diff --git a/pitest-maven-verification/src/test/resources/pit-testng/pom.xml b/pitest-maven-verification/src/test/resources/pit-testng/pom.xml index d46904b35..606b269b3 100644 --- a/pitest-maven-verification/src/test/resources/pit-testng/pom.xml +++ b/pitest-maven-verification/src/test/resources/pit-testng/pom.xml @@ -10,7 +10,7 @@ org.testng testng - 6.1.1 + 6.9.10 test diff --git a/pitest/src/main/java/org/pitest/testng/TestNGTestUnit.java b/pitest/src/main/java/org/pitest/testng/TestNGTestUnit.java index c32fa2c16..7bdd5447e 100644 --- a/pitest/src/main/java/org/pitest/testng/TestNGTestUnit.java +++ b/pitest/src/main/java/org/pitest/testng/TestNGTestUnit.java @@ -26,6 +26,7 @@ import org.testng.IInvokedMethodListener; import org.testng.ITestContext; import org.testng.ITestListener; +import org.testng.ITestNGListener; import org.testng.ITestResult; import org.testng.SkipException; import org.testng.TestNG; @@ -47,8 +48,9 @@ public class TestNGTestUnit extends AbstractTestUnit { private static final MutableTestListenerWrapper LISTENER = new MutableTestListenerWrapper(); static { - TESTNG.addListener(LISTENER); - TESTNG.addInvokedMethodListener(new FailFast(LISTENER)); + // force using TestNG.addListener(ITestNGListener) to be compatible with TestNG 7.x + TESTNG.addListener((ITestNGListener)LISTENER); + TESTNG.addListener((ITestNGListener)new FailFast(LISTENER)); } private final Class clazz; diff --git a/pom.xml b/pom.xml index 93830604a..c1767cb5c 100644 --- a/pom.xml +++ b/pom.xml @@ -297,7 +297,7 @@ 2.2.1 1.7.3 2.17 - 6.8.21 + 6.9.10 1.7.12 ${surefire.version}