Accepting request 973218 from Java:packages

Fix build with testng 7.4.0 and maven-shared-utils 3.3.3

OBS-URL: https://build.opensuse.org/request/show/973218
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/maven-surefire?expand=0&rev=6
This commit is contained in:
Dominique Leuenberger 2022-04-28 21:07:40 +00:00 committed by Git OBS Bridge
commit 4ff2a08be6
8 changed files with 78 additions and 40 deletions

View File

@ -1,15 +1,3 @@
From 73cbf7936466f7e32483b871813a82f214d44b30 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
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 @@
@ -18,15 +6,13 @@ index 8aee308..e1b37ea 100644
<artifactId>testng</artifactId>
- <version>5.10</version>
- <classifier>jdk15</classifier>
+ <version>6.11</version>
+ <version>7.4.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
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
@@ -63,7 +63,7 @@ public void configure( TestNG testng, Map<String, String> options )
testng.setUseDefaultListeners( false );
configureInstance( testng, options );
// TODO: we should have the Profile so that we can decide if this is needed or not
@ -35,6 +21,14 @@ index c639ce9..3f05eed 100644
}
@Override
--
2.17.1
--- 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<String, String> options )
String parallel = options.get( PARALLEL_PROP );
if ( parallel != null )
{
- suite.setParallel( parallel );
+ suite.setParallel( XmlSuite.ParallelMode.getValidParallel( parallel ) );
}
}

View File

@ -1,15 +1,34 @@
From 6f1e595890521c0c3448457f112c1598d8b9c7f9 Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
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
@@ -130,14 +130,24 @@
String jvmArgLine = newJvmArgLine( forkNumber );
if ( !jvmArgLine.isEmpty() )
{
- cli.createArg()
- .setLine( jvmArgLine );
+ try
+ {
+ cli.createArg().setLine( jvmArgLine );
+ }
+ catch (Exception e)
+ {
+ }
}
if ( getDebugLine() != null && !getDebugLine().isEmpty() )
{
- cli.createArg()
- .setLine( getDebugLine() );
+ try
+ {
+ cli.createArg().setLine( getDebugLine() );
+ }
+ catch (Exception 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 +96,6 @@ index dad9808..111b92b 100644
{
xmlWriter.startElement( "properties" );
for ( final Entry<String, String> 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 +103,7 @@ index efc9342..6492689 100644
<commonsLang3Version>3.5</commonsLang3Version>
<commonsIoVersion>2.5</commonsIoVersion>
- <mavenSharedUtilsVersion>0.9</mavenSharedUtilsVersion>
+ <mavenSharedUtilsVersion>3.2.1</mavenSharedUtilsVersion>
+ <mavenSharedUtilsVersion>3.3.3</mavenSharedUtilsVersion>
<powermockVersion>2.0.0-beta.5</powermockVersion>
<maven.surefire.scm.devConnection>scm:git:https://gitbox.apache.org/repos/asf/maven-surefire.git</maven.surefire.scm.devConnection>
<maven.site.path>surefire-archives/surefire-LATEST</maven.site.path>
--
2.17.1

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Wed Apr 27 13:52:13 UTC 2022 - Fridrich Strba <fstrba@suse.com>
- 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 <fstrba@suse.com>

View File

@ -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

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Wed Apr 27 13:52:13 UTC 2022 - Fridrich Strba <fstrba@suse.com>
- 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 <fstrba@suse.com>

View File

@ -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

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Wed Apr 27 13:52:13 UTC 2022 - Fridrich Strba <fstrba@suse.com>
- 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 <fstrba@suse.com>

View File

@ -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