From 9a4251a638a253e1527d0bf45aea19667dcf63d89f0a454a161a4f2dc4772e35 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Tue, 26 Apr 2022 10:00:11 +0000 Subject: [PATCH 1/5] OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-surefire?expand=0&rev=19 --- 0003-Port-to-TestNG-7.4.0.patch | 34 +++++++++++ 0004-Port-to-current-maven-shared-utils.patch | 60 +++++++++++++------ maven-surefire-plugins.spec | 2 +- maven-surefire-provider-junit5.spec | 2 +- maven-surefire.spec | 2 +- 5 files changed, 79 insertions(+), 21 deletions(-) create mode 100644 0003-Port-to-TestNG-7.4.0.patch 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 From b0a3e2c274d50e9777c552fcd9d867d32f5e24c210ed07f0b99264fe0316c3fb Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Tue, 26 Apr 2022 10:05:26 +0000 Subject: [PATCH 2/5] OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-surefire?expand=0&rev=20 --- 0003-Port-to-TestNG-6.11.patch | 40 ---------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 0003-Port-to-TestNG-6.11.patch diff --git a/0003-Port-to-TestNG-6.11.patch b/0003-Port-to-TestNG-6.11.patch deleted file mode 100644 index 3c70945..0000000 --- a/0003-Port-to-TestNG-6.11.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 73cbf7936466f7e32483b871813a82f214d44b30 Mon Sep 17 00:00:00 2001 -From: Mikolaj Izdebski -Date: Mon, 10 Jul 2017 10:37:50 +0200 -Subject: [PATCH 3/4] Port to TestNG 6.11 - ---- - surefire-providers/surefire-testng/pom.xml | 3 +-- - .../maven/surefire/testng/conf/AbstractDirectConfigurator.java | 2 +- - 2 files changed, 2 insertions(+), 3 deletions(-) - -diff --git a/surefire-providers/surefire-testng/pom.xml b/surefire-providers/surefire-testng/pom.xml -index 8aee308..e1b37ea 100644 ---- a/surefire-providers/surefire-testng/pom.xml -+++ b/surefire-providers/surefire-testng/pom.xml -@@ -51,8 +51,7 @@ - - org.testng - testng -- 5.10 -- jdk15 -+ 6.11 - provided - - -diff --git 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 -index c639ce9..3f05eed 100644 ---- 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 abstract class AbstractDirectConfigurator - 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 --- -2.17.1 - From 1cf773976a767811a8ef270d667295f21bb8323306fe93f4f2592e016f24a02b Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Tue, 26 Apr 2022 13:45:16 +0000 Subject: [PATCH 3/5] OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-surefire?expand=0&rev=21 --- 0004-Port-to-current-maven-shared-utils.patch | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/0004-Port-to-current-maven-shared-utils.patch b/0004-Port-to-current-maven-shared-utils.patch index 1b30f57..1de8754 100644 --- a/0004-Port-to-current-maven-shared-utils.patch +++ b/0004-Port-to-current-maven-shared-utils.patch @@ -1,14 +1,6 @@ --- 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 @@ +@@ -130,14 +130,24 @@ String jvmArgLine = newJvmArgLine( forkNumber ); if ( !jvmArgLine.isEmpty() ) { @@ -18,9 +10,8 @@ + { + cli.createArg().setLine( jvmArgLine ); + } -+ catch ( CommandLineException e ) ++ finally + { -+ throw new SurefireBooterForkException( "Problem to set jvmArgLine: " + e.getMessage(), e ); + } } @@ -32,9 +23,8 @@ + { + cli.createArg().setLine( getDebugLine() ); + } -+ catch ( CommandLineException e ) ++ finally + { -+ throw new SurefireBooterForkException( "Problem to set debug line: " + e.getMessage(), e ); + } } From 8d4061f84db0e9898a9005da40b9983da43ee270e30723ca81f2508c33fd549f Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Tue, 26 Apr 2022 14:10:00 +0000 Subject: [PATCH 4/5] OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-surefire?expand=0&rev=22 --- 0004-Port-to-current-maven-shared-utils.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/0004-Port-to-current-maven-shared-utils.patch b/0004-Port-to-current-maven-shared-utils.patch index 1de8754..0a01e3e 100644 --- a/0004-Port-to-current-maven-shared-utils.patch +++ b/0004-Port-to-current-maven-shared-utils.patch @@ -10,7 +10,7 @@ + { + cli.createArg().setLine( jvmArgLine ); + } -+ finally ++ catch (Exception e) + { + } } @@ -23,7 +23,7 @@ + { + cli.createArg().setLine( getDebugLine() ); + } -+ finally ++ catch (Exception e) + { + } } From e96eec457233b2cf33f50d856c4fd86c8ef8b512e620ce3e6eded8f90dfd020d Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Wed, 27 Apr 2022 13:55:41 +0000 Subject: [PATCH 5/5] OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-surefire?expand=0&rev=23 --- maven-surefire-plugins.changes | 10 ++++++++++ maven-surefire-provider-junit5.changes | 10 ++++++++++ maven-surefire.changes | 10 ++++++++++ 3 files changed, 30 insertions(+) diff --git a/maven-surefire-plugins.changes b/maven-surefire-plugins.changes index 796d40e..ec5112b 100644 --- a/maven-surefire-plugins.changes +++ b/maven-surefire-plugins.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Wed Apr 27 13:52:13 UTC 2022 - Fridrich Strba + +- Modified patches: + * 0004-Port-to-current-maven-shared-utils.patch + + Add some try/catch blocks so that we catch new exceptions + potentially thrown by maven-shared-utils-3.3.x + * 0003-Port-to-TestNG-6.11.patch -> 0003-Port-to-TestNG-7.4.0.patch + + Allow building with the new testng 7.4.0 + ------------------------------------------------------------------- Tue Mar 22 13:53:34 UTC 2022 - Fridrich Strba diff --git a/maven-surefire-provider-junit5.changes b/maven-surefire-provider-junit5.changes index 159206f..f64be81 100644 --- a/maven-surefire-provider-junit5.changes +++ b/maven-surefire-provider-junit5.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Wed Apr 27 13:52:13 UTC 2022 - Fridrich Strba + +- Modified patches: + * 0004-Port-to-current-maven-shared-utils.patch + + Add some try/catch blocks so that we catch new exceptions + potentially thrown by maven-shared-utils-3.3.x + * 0003-Port-to-TestNG-6.11.patch -> 0003-Port-to-TestNG-7.4.0.patch + + Allow building with the new testng 7.4.0 + ------------------------------------------------------------------- Tue Mar 22 13:53:55 UTC 2022 - Fridrich Strba diff --git a/maven-surefire.changes b/maven-surefire.changes index d73daf7..c575f0e 100644 --- a/maven-surefire.changes +++ b/maven-surefire.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Wed Apr 27 13:52:13 UTC 2022 - Fridrich Strba + +- Modified patches: + * 0004-Port-to-current-maven-shared-utils.patch + + Add some try/catch blocks so that we catch new exceptions + potentially thrown by maven-shared-utils-3.3.x + * 0003-Port-to-TestNG-6.11.patch -> 0003-Port-to-TestNG-7.4.0.patch + + Allow building with the new testng 7.4.0 + ------------------------------------------------------------------- Tue Mar 22 13:52:58 UTC 2022 - Fridrich Strba