diff --git a/0003-Port-to-TestNG-7.4.0.patch b/0003-Port-to-TestNG-7.4.0.patch new file mode 100644 index 0000000..791a4f4 --- /dev/null +++ b/0003-Port-to-TestNG-7.4.0.patch @@ -0,0 +1,34 @@ +--- a/surefire-providers/surefire-testng/pom.xml ++++ b/surefire-providers/surefire-testng/pom.xml +@@ -51,8 +51,7 @@ + + org.testng + testng +- 5.10 +- jdk15 ++ 7.4.0 + provided + + +--- a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/AbstractDirectConfigurator.java ++++ b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/AbstractDirectConfigurator.java +@@ -63,7 +63,7 @@ public void configure( TestNG testng, Map options ) + testng.setUseDefaultListeners( false ); + configureInstance( testng, options ); + // TODO: we should have the Profile so that we can decide if this is needed or not +- testng.setListenerClasses( loadListenerClasses( listeners ) ); ++ testng.setListenerClasses( ( List ) loadListenerClasses( listeners ) ); + } + + @Override +--- a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java ++++ b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java +@@ -68,7 +68,7 @@ public void configure( XmlSuite suite, Map options ) + String parallel = options.get( PARALLEL_PROP ); + if ( parallel != null ) + { +- suite.setParallel( parallel ); ++ suite.setParallel( XmlSuite.ParallelMode.getValidParallel( parallel ) ); + } + } + diff --git a/0004-Port-to-current-maven-shared-utils.patch b/0004-Port-to-current-maven-shared-utils.patch index 109e265..1b30f57 100644 --- a/0004-Port-to-current-maven-shared-utils.patch +++ b/0004-Port-to-current-maven-shared-utils.patch @@ -1,15 +1,44 @@ -From 6f1e595890521c0c3448457f112c1598d8b9c7f9 Mon Sep 17 00:00:00 2001 -From: Michael Simacek -Date: Fri, 16 Mar 2018 13:45:01 +0100 -Subject: [PATCH 4/4] Port to current maven-shared-utils - ---- - .../surefire/report/StatelessXmlReporter.java | 16 ++++++++++------ - pom.xml | 2 +- - 2 files changed, 11 insertions(+), 7 deletions(-) - -diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java -index dad9808..111b92b 100644 +--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/DefaultForkConfiguration.java 2022-04-26 11:44:38.061316377 +0200 ++++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/DefaultForkConfiguration.java 2022-04-26 11:50:27.427430853 +0200 +@@ -22,6 +22,7 @@ + import org.apache.maven.plugin.surefire.JdkAttributes; + import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.OutputStreamFlushableCommandline; + import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; ++import org.apache.maven.shared.utils.cli.CommandLineException; + import org.apache.maven.surefire.booter.AbstractPathConfiguration; + import org.apache.maven.surefire.booter.Classpath; + import org.apache.maven.surefire.booter.StartupConfiguration; +@@ -130,14 +131,26 @@ + String jvmArgLine = newJvmArgLine( forkNumber ); + if ( !jvmArgLine.isEmpty() ) + { +- cli.createArg() +- .setLine( jvmArgLine ); ++ try ++ { ++ cli.createArg().setLine( jvmArgLine ); ++ } ++ catch ( CommandLineException e ) ++ { ++ throw new SurefireBooterForkException( "Problem to set jvmArgLine: " + e.getMessage(), e ); ++ } + } + + if ( getDebugLine() != null && !getDebugLine().isEmpty() ) + { +- cli.createArg() +- .setLine( getDebugLine() ); ++ try ++ { ++ cli.createArg().setLine( getDebugLine() ); ++ } ++ catch ( CommandLineException e ) ++ { ++ throw new SurefireBooterForkException( "Problem to set debug line: " + e.getMessage(), e ); ++ } + } + + resolveClasspath( cli, findStartClass( config ), config ); --- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java +++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java @@ -237,6 +237,10 @@ public class StatelessXmlReporter @@ -77,8 +106,6 @@ index dad9808..111b92b 100644 { xmlWriter.startElement( "properties" ); for ( final Entry entry : systemProperties.entrySet() ) -diff --git a/pom.xml b/pom.xml -index efc9342..6492689 100644 --- a/pom.xml +++ b/pom.xml @@ -91,7 +91,7 @@ @@ -86,10 +113,7 @@ index efc9342..6492689 100644 3.5 2.5 - 0.9 -+ 3.2.1 ++ 3.3.3 2.0.0-beta.5 scm:git:https://gitbox.apache.org/repos/asf/maven-surefire.git surefire-archives/surefire-LATEST --- -2.17.1 - diff --git a/maven-surefire-plugins.spec b/maven-surefire-plugins.spec index 35b0fdf..107414a 100644 --- a/maven-surefire-plugins.spec +++ b/maven-surefire-plugins.spec @@ -31,7 +31,7 @@ Source1: generate-tarball.sh Source2: http://junit.sourceforge.net/cpl-v10.html Patch0: 0001-Maven-3.patch Patch1: 0002-Port-to-current-doxia.patch -Patch2: 0003-Port-to-TestNG-6.11.patch +Patch2: 0003-Port-to-TestNG-7.4.0.patch Patch3: 0004-Port-to-current-maven-shared-utils.patch BuildRequires: fdupes BuildRequires: java-devel >= 1.8 diff --git a/maven-surefire-provider-junit5.spec b/maven-surefire-provider-junit5.spec index 64fd2ac..ee3d8a2 100644 --- a/maven-surefire-provider-junit5.spec +++ b/maven-surefire-provider-junit5.spec @@ -31,7 +31,7 @@ Source1: generate-tarball.sh Source2: http://junit.sourceforge.net/cpl-v10.html Patch0: 0001-Maven-3.patch Patch1: 0002-Port-to-current-doxia.patch -Patch2: 0003-Port-to-TestNG-6.11.patch +Patch2: 0003-Port-to-TestNG-7.4.0.patch Patch3: 0004-Port-to-current-maven-shared-utils.patch BuildRequires: fdupes BuildRequires: java-devel >= 1.8 diff --git a/maven-surefire.spec b/maven-surefire.spec index d758d3a..98c23dc 100644 --- a/maven-surefire.spec +++ b/maven-surefire.spec @@ -31,7 +31,7 @@ Source2: http://junit.sourceforge.net/cpl-v10.html Source10: %{name}-build.tar.xz Patch0: 0001-Maven-3.patch Patch1: 0002-Port-to-current-doxia.patch -Patch2: 0003-Port-to-TestNG-6.11.patch +Patch2: 0003-Port-to-TestNG-7.4.0.patch Patch3: 0004-Port-to-current-maven-shared-utils.patch Patch10: %{name}-bootstrap-resources.patch BuildRequires: ant