Update to upstream version 2.22.0

This commit is contained in:
Michael Simacek 2018-07-02 14:28:31 +02:00
parent eaf172a45f
commit 91e766f314
7 changed files with 161 additions and 135 deletions

1
.gitignore vendored
View File

@ -23,3 +23,4 @@ surefire-2.10-source-release.zip
/surefire-2.20-source-release.zip
/surefire-2.20.1-source-release.zip
/surefire-2.21.0-source-release.zip
/surefire-2.22.0-source-release.zip

View File

@ -1,34 +1,34 @@
From 7d877972a669298678b68733dcb9c344cef79a4d Mon Sep 17 00:00:00 2001
From 3bb1ab3a99b7db611b5d265701e1ba293413b027 Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
Date: Thu, 5 May 2016 11:20:48 +0200
Subject: [PATCH 1/4] Maven 3
---
.../java/org/apache/maven/plugin/surefire/SurefireHelper.java | 11 +----------
.../apache/maven/plugin/surefire/SurefireHelper.java | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireHelper.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireHelper.java
index 7a26c27..de36f03 100644
index dd29cb4..dc7915c 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireHelper.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireHelper.java
@@ -204,16 +204,7 @@ public final class SurefireHelper
private static String getFailureBehavior( MavenExecutionRequest request )
throws NoSuchMethodException, InvocationTargetException, IllegalAccessException
{
- try
- {
- return request.getFailureBehavior();
- }
- catch ( NoSuchMethodError e )
- {
- return (String) request.getClass()
- .getMethod( "getReactorFailureBehavior" )
- .invoke( request );
- }
+ return request.getReactorFailureBehavior();
}
private static boolean failIfNoTests( SurefireReportParameters reportParameters )
private static String getFailureBehavior( MavenExecutionRequest request )
throws NoSuchMethodException, InvocationTargetException, IllegalAccessException
{
- try
- {
- return request.getFailureBehavior();
- }
- catch ( NoSuchMethodError e )
- {
- return (String) request.getClass()
- .getMethod( "getReactorFailureBehavior" )
- .invoke( request );
- }
+ return request.getReactorFailureBehavior();
}
private static boolean failIfNoTests( SurefireReportParameters reportParameters )
--
2.14.3
2.17.1

View File

@ -1,25 +1,25 @@
From 77244f1f19b547a137d054ebf3c745532b466be8 Mon Sep 17 00:00:00 2001
From 16e1a53ff612f4a9a777e09cdc45988e9abbe2e2 Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
Date: Thu, 5 May 2016 11:19:09 +0200
Subject: [PATCH 2/4] Fix test with doxia-1.7
Date: Fri, 29 Jun 2018 12:44:37 +0200
Subject: [PATCH 2/4] Port to current doxia
---
.../apache/maven/plugins/surefire/report/SurefireReportGenerator.java | 2 +-
.../maven/plugins/surefire/report/SurefireReportGenerator.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java
index 3f537f3..c5804f8 100644
index f9b9480..f142c8d 100644
--- a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java
+++ b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java
@@ -27,7 +27,7 @@ import java.util.Map;
import java.util.ResourceBundle;
import org.apache.maven.doxia.markup.HtmlMarkup;
import org.apache.maven.doxia.sink.Sink;
-import org.apache.maven.doxia.sink.SinkEventAttributeSet;
+import org.apache.maven.doxia.sink.impl.SinkEventAttributeSet;
import org.apache.maven.doxia.util.DoxiaUtils;
import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
import org.apache.maven.reporting.MavenReportException;
@@ -26,7 +26,7 @@ import java.util.Locale;
import java.util.Map;
import org.apache.maven.doxia.markup.HtmlMarkup;
import org.apache.maven.doxia.sink.Sink;
-import org.apache.maven.doxia.sink.SinkEventAttributeSet;
+import org.apache.maven.doxia.sink.impl.SinkEventAttributeSet;
import org.apache.maven.doxia.util.DoxiaUtils;
import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
import org.apache.maven.reporting.MavenReportException;
--
2.14.3
2.17.1

View File

@ -1,40 +1,40 @@
From 75266d98099412ded9b0b8574e1fb115ad61c1b4 Mon Sep 17 00:00:00 2001
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 +--
.../apache/maven/surefire/testng/conf/AbstractDirectConfigurator.java | 2 +-
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 db91b39..960f4e6 100644
index 8aee308..e1b37ea 100644
--- a/surefire-providers/surefire-testng/pom.xml
+++ b/surefire-providers/surefire-testng/pom.xml
@@ -51,8 +51,7 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
- <version>5.10</version>
- <classifier>jdk15</classifier>
+ <version>6.11</version>
<scope>provided</scope>
</dependency>
</dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
- <version>5.10</version>
- <classifier>jdk15</classifier>
+ <version>6.11</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 73ccdb7..41ed4f0 100644
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
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.14.3
2.17.1

View File

@ -1,95 +1,95 @@
From 76987d0d968c037e47afa660580ab02f9d99453a Mon Sep 17 00:00:00 2001
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
---
.../plugin/surefire/report/StatelessXmlReporter.java | 16 ++++++++++------
pom.xml | 2 +-
.../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 ecd6310..5fc04e5 100644
index dad9808..111b92b 100644
--- 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
}
ppw.endElement(); // TestSuite
}
+ catch ( IOException e )
+ {
+ throw new RuntimeException(e);
+ }
finally
{
closeQuietly( fw );
}
ppw.endElement(); // TestSuite
}
+ catch (IOException e)
+ {
+ throw new RuntimeException(e);
+ }
finally
{
closeQuietly( fw );
@@ -323,7 +327,7 @@ public class StatelessXmlReporter
}
private static void startTestElement( XMLWriter ppw, WrappedReportEntry report, String reportNameSuffix,
- String timeAsString )
+ String timeAsString ) throws IOException
{
ppw.startElement( "testcase" );
ppw.addAttribute( "name", report.getReportName() );
}
private static void startTestElement( XMLWriter ppw, WrappedReportEntry report, String reportNameSuffix,
- String timeAsString )
+ String timeAsString ) throws IOException
{
ppw.startElement( "testcase" );
ppw.addAttribute( "name", report.getReportName() );
@@ -346,7 +350,7 @@ public class StatelessXmlReporter
}
private void createTestSuiteElement( XMLWriter ppw, WrappedReportEntry report, TestSetStats testSetStats,
- String timeAsString )
+ String timeAsString ) throws IOException
{
ppw.startElement( "testsuite" );
}
private void createTestSuiteElement( XMLWriter ppw, WrappedReportEntry report, TestSetStats testSetStats,
- String timeAsString )
+ String timeAsString ) throws IOException
{
ppw.startElement( "testsuite" );
@@ -373,7 +377,7 @@ public class StatelessXmlReporter
private static void getTestProblems( OutputStreamWriter outputStreamWriter, XMLWriter ppw,
WrappedReportEntry report, boolean trimStackTrace, OutputStream fw,
- String testErrorType, boolean createOutErrElementsInside )
+ String testErrorType, boolean createOutErrElementsInside ) throws IOException
{
ppw.startElement( testErrorType );
private static void getTestProblems( OutputStreamWriter outputStreamWriter, XMLWriter ppw,
WrappedReportEntry report, boolean trimStackTrace, OutputStream fw,
- String testErrorType, boolean createOutErrElementsInside )
+ String testErrorType, boolean createOutErrElementsInside ) throws IOException
{
ppw.startElement( testErrorType );
@@ -418,7 +422,7 @@ public class StatelessXmlReporter
// Create system-out and system-err elements
private static void createOutErrElements( OutputStreamWriter outputStreamWriter, XMLWriter ppw,
- WrappedReportEntry report, OutputStream fw )
+ WrappedReportEntry report, OutputStream fw ) throws IOException
{
EncodingOutputStream eos = new EncodingOutputStream( fw );
addOutputStreamElement( outputStreamWriter, eos, ppw, report.getStdout(), "system-out" );
// Create system-out and system-err elements
private static void createOutErrElements( OutputStreamWriter outputStreamWriter, XMLWriter ppw,
- WrappedReportEntry report, OutputStream fw )
+ WrappedReportEntry report, OutputStream fw ) throws IOException
{
EncodingOutputStream eos = new EncodingOutputStream( fw );
addOutputStreamElement( outputStreamWriter, eos, ppw, report.getStdout(), "system-out" );
@@ -428,7 +432,7 @@ public class StatelessXmlReporter
private static void addOutputStreamElement( OutputStreamWriter outputStreamWriter,
EncodingOutputStream eos, XMLWriter xmlWriter,
Utf8RecodingDeferredFileOutputStream utf8RecodingDeferredFileOutputStream,
- String name )
+ String name ) throws IOException
{
if ( utf8RecodingDeferredFileOutputStream != null && utf8RecodingDeferredFileOutputStream.getByteCount() > 0 )
{
private static void addOutputStreamElement( OutputStreamWriter outputStreamWriter,
EncodingOutputStream eos, XMLWriter xmlWriter,
Utf8RecodingDeferredFileOutputStream utf8RecodingDeferredFileOutputStream,
- String name )
+ String name ) throws IOException
{
if ( utf8RecodingDeferredFileOutputStream != null && utf8RecodingDeferredFileOutputStream.getByteCount() > 0 )
{
@@ -458,7 +462,7 @@ public class StatelessXmlReporter
*
* @param xmlWriter The test suite to report to
*/
- private static void showProperties( XMLWriter xmlWriter, Map<String, String> systemProperties )
+ private static void showProperties( XMLWriter xmlWriter, Map<String, String> systemProperties ) throws IOException
{
xmlWriter.startElement( "properties" );
for ( final Entry<String, String> entry : systemProperties.entrySet() )
*
* @param xmlWriter The test suite to report to
*/
- private static void showProperties( XMLWriter xmlWriter, Map<String, String> systemProperties )
+ private static void showProperties( XMLWriter xmlWriter, Map<String, String> systemProperties ) throws IOException
{
xmlWriter.startElement( "properties" );
for ( final Entry<String, String> entry : systemProperties.entrySet() )
diff --git a/pom.xml b/pom.xml
index f344d50..109e930 100644
index efc9342..6492689 100644
--- a/pom.xml
+++ b/pom.xml
@@ -91,7 +91,7 @@
<mavenPluginPluginVersion>3.5</mavenPluginPluginVersion>
<commonsLang3Version>3.5</commonsLang3Version>
<commonsIoVersion>2.5</commonsIoVersion>
- <mavenSharedUtilsVersion>0.9</mavenSharedUtilsVersion>
+ <mavenSharedUtilsVersion>3.2.1</mavenSharedUtilsVersion>
<powermockVersion>2.0.0-beta.5</powermockVersion>
<maven.surefire.scm.devConnection>scm:git:https://git-wip-us.apache.org/repos/asf/maven-surefire.git</maven.surefire.scm.devConnection>
<maven.site.path>surefire-archives/surefire-LATEST</maven.site.path>
<mavenPluginPluginVersion>3.5</mavenPluginPluginVersion>
<commonsLang3Version>3.5</commonsLang3Version>
<commonsIoVersion>2.5</commonsIoVersion>
- <mavenSharedUtilsVersion>0.9</mavenSharedUtilsVersion>
+ <mavenSharedUtilsVersion>3.2.1</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.14.3
2.17.1

View File

@ -1,5 +1,7 @@
%bcond_without junit5
Name: maven-surefire
Version: 2.21.0
Version: 2.22.0
Release: 1%{?dist}
Epoch: 0
Summary: Test framework project
@ -11,7 +13,7 @@ Source0: http://repo2.maven.org/maven2/org/apache/maven/surefire/surefire
Source2: http://junit.sourceforge.net/cpl-v10.html
Patch0: 0001-Maven-3.patch
Patch1: 0002-Fix-test-with-doxia-1.7.patch
Patch1: 0002-Port-to-current-doxia.patch
Patch2: 0003-Port-to-TestNG-6.11.patch
Patch3: 0004-Port-to-current-maven-shared-utils.patch
@ -45,6 +47,10 @@ BuildRequires: mvn(org.fusesource.jansi:jansi)
BuildRequires: mvn(org.testng:testng)
BuildRequires: mvn(org.testng:testng::jdk15:)
%if %{with junit5}
BuildRequires: mvn(org.junit.platform:junit-platform-launcher)
%endif
# PpidChecker relies on /usr/bin/ps to check process uptime
Requires: procps-ng
@ -69,6 +75,14 @@ Summary: JUnit provider for Maven Surefire
%description provider-junit
JUnit provider for Maven Surefire.
%if %{with junit5}
%package provider-junit5
Summary: JUnit 5 provider for Maven Surefire
%description provider-junit5
JUnit 5 provider for Maven Surefire.
%endif
%package provider-testng
Summary: TestNG provider for Maven Surefire
@ -121,6 +135,10 @@ sed -i /-Xdoclint:all/d pom.xml
%pom_disable_module surefire-shadefire
%if %{without junit5}
%pom_disable_module surefire-junit-platform surefire-providers
%endif
%pom_remove_dep -r org.apache.maven.surefire:surefire-shadefire
# Help plugin is needed only to evaluate effective Maven settings.
@ -131,7 +149,7 @@ sed -i /-Xdoclint:all/d pom.xml
%pom_remove_plugin -r :jacoco-maven-plugin
# Not in Fedora
%pom_remove_plugin :animal-sniffer-maven-plugin
%pom_remove_plugin -r :animal-sniffer-maven-plugin
# Complains
%pom_remove_plugin -r :apache-rat-plugin
%pom_remove_plugin -r :maven-enforcer-plugin
@ -151,6 +169,7 @@ sed -i /-Xdoclint:all/d pom.xml
%build
%mvn_package ":*{surefire-plugin,report-plugin}*" @1
%mvn_package ":*junit-platform*" junit5
%mvn_package ":*{junit,testng,failsafe-plugin,report-parser}*" @1
%mvn_package ":*tests*" __noinstall
# tests turned off because they need jmock
@ -171,11 +190,17 @@ sed -i /-Xdoclint:all/d pom.xml
%files provider-junit -f .mfiles-junit
%files provider-testng -f .mfiles-testng
%files -n maven-failsafe-plugin -f .mfiles-failsafe-plugin
%if %{with junit5}
%files provider-junit5 -f .mfiles-junit5
%endif
%files javadoc -f .mfiles-javadoc
%doc LICENSE NOTICE cpl-v10.html
%changelog
* Fri Jun 29 2018 Michael Simacek <msimacek@redhat.com> - 0:2.22.0-1
- Update to upstream version 2.22.0
* Fri Mar 16 2018 Michael Simacek <msimacek@redhat.com> - 0:2.21.0-1
- Update to upstream version 2.21.0

View File

@ -1,2 +1,2 @@
SHA512 (surefire-2.21.0-source-release.zip) = d9fb02057f6485337af7c39ceca1a528543d904978376113bb1924584ddf2c1d1fed2646923befeb1144b007cbb329724c68795d31eccc2559b15fc915bd7afb
SHA512 (surefire-2.22.0-source-release.zip) = 0ad179725ba38fda0fcd9d68cc1efb49f4570ef8c4f547e88cd8552816cc5db12f1e2fe5b4d09016c8b2e94b6274027194e0852fcf90bd1fbd6f93cd908e620f
SHA512 (cpl-v10.html) = f7aa86fafb6a7831b1a5302099fbfe95361bcb5c49a2bc7aac0f5d53cea6c92fc3adbba897a54ab5b0cf32771cdc933fc5bb233461fbd48254a250d0d59109c9