diff --git a/maven-surefire-plugin/src/site/apt/examples/junit-platform.apt.vm b/maven-surefire-plugin/src/site/apt/examples/junit-platform.apt.vm
index 5c02c6d1c8..26e5f1b1c3 100644
--- a/maven-surefire-plugin/src/site/apt/examples/junit-platform.apt.vm
+++ b/maven-surefire-plugin/src/site/apt/examples/junit-platform.apt.vm
@@ -349,44 +349,33 @@ Using JUnit 5 Platform
+---+
-** How to run TestNG tests within Jupiter engine
+** How to run TestNG tests within the JUnit Platform
You can run TestNG tests combined with JUnit5 tests.
For more information see this
- {{{https://github.com/apache/maven-surefire/tree/master/surefire-its/src/test/resources/junit5-testng}example}}.
+ {{{https://github.com/apache/maven-surefire/tree/master/surefire-its/src/test/resources/junit5-testng}example}}
+ and {{{https://github.com/junit-team/testng-engine}TestNG Engine for the JUnit Platform}}.
+---+
org.testng
testng
- 7.1.0
+ 7.4.0
test
- com.github.testng-team
- testng-junit5
- 0.0.1
- test
-
-
- org.junit.platform
- junit-platform-engine
-
-
-
-
- org.junit.jupiter
- junit-jupiter-api
- 5.6.2
+ org.junit.support
+ testng-engine
+ 1.0.1
test
+---+
The Maven does not take any responsibility for broken compatibilities in this case and the responsibility for
- the dependency <<>>.
+ the dependency <<>>.
** JUnit Runner
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1787JUnit5IT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1787JUnit5IT.java
index f64ad702bd..ede3d11b84 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1787JUnit5IT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1787JUnit5IT.java
@@ -96,6 +96,18 @@ public void selectJUnit5()
"Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider" );
}
+ @Test
+ public void testNg()
+ {
+ unpack( "junit5-testng" )
+ .activateProfile( "testng-only" )
+ .executeTest()
+ .verifyErrorFree( 1 )
+ .verifyTextInLog( "Running pkg.TestNGTest" )
+ .verifyTextInLog(
+ "Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider" );
+ }
+
@Test
public void testNgWithJupiterApi()
{
@@ -107,7 +119,6 @@ public void testNgWithJupiterApi()
.verifyTextInLog( "Running pkg.TestNGTest" )
.verifyTextInLog(
"Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider" );
-
}
@Test
diff --git a/surefire-its/src/test/resources/junit5-testng/pom.xml b/surefire-its/src/test/resources/junit5-testng/pom.xml
index c18e4649c6..fd383106dc 100644
--- a/surefire-its/src/test/resources/junit5-testng/pom.xml
+++ b/surefire-its/src/test/resources/junit5-testng/pom.xml
@@ -21,74 +21,109 @@
- 4.0.0
+ 4.0.0
- org.example
- testng-junit5
- 1.0-SNAPSHOT
+ org.example
+ testng-junit5
+ 1.0-SNAPSHOT
-
- UTF-8
- ${java.specification.version}
- ${java.specification.version}
-
+ Project with mixed TestNG and JUnit5 tests.
-
+
+ UTF-8
+ ${java.specification.version}
+ ${java.specification.version}
+
+
+
+
+ org.testng
+ testng
+ 7.5
+ test
+
+
+ org.junit.support
+ testng-engine
+ 1.0.1
+ test
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ ${surefire.version}
+
+
+
+
+
+
+
+ testng-only
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+
+
+ **/TestNGTest.java
+
+
+
+
+
+
+
+ junit5-engine
+
- org.testng
- testng
- 7.1.0
- test
+ org.junit.jupiter
+ junit-jupiter-engine
+
+
+ 5.7.2
+ test
-
- com.github.testng-team
- testng-junit5
- 0.0.1
- test
+
+
+
+ junit5-api
+
+
+
+
+ org.junit.support
+ testng-engine
-
- org.junit.platform
- junit-platform-engine
-
+
+ org.junit.platform
+ junit-platform-engine
+
+
+
+
+
+
+ org.junit.jupiter
+ junit-jupiter-api
+
+
+ 5.8.2
+ test
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- ${surefire.version}
-
-
-
-
-
-
-
- junit5-engine
-
-
- org.junit.jupiter
- junit-jupiter-engine
- 5.6.2
- test
-
-
-
-
- junit5-api
-
-
- org.junit.jupiter
- junit-jupiter-api
- 5.6.2
- test
-
-
-
-
+
+
+
diff --git a/surefire-its/src/test/resources/junit5-testng/src/test/java/pkg/JUnit5Test.java b/surefire-its/src/test/resources/junit5-testng/src/test/java/pkg/JUnit5Test.java
index 916eeab5f0..eea7289fd7 100644
--- a/surefire-its/src/test/resources/junit5-testng/src/test/java/pkg/JUnit5Test.java
+++ b/surefire-its/src/test/resources/junit5-testng/src/test/java/pkg/JUnit5Test.java
@@ -4,7 +4,7 @@
class JUnit5Test {
@Test
- public void test() {
+ void test() {
}
}