From 91e766f31467e5e251e183b64122d2d98bca5a01 Mon Sep 17 00:00:00 2001 From: Michael Simacek Date: Mon, 2 Jul 2018 14:28:31 +0200 Subject: [PATCH] Update to upstream version 2.22.0 --- .gitignore | 1 + 0001-Maven-3.patch | 42 ++--- ....patch => 0002-Port-to-current-doxia.patch | 30 ++-- 0003-Port-to-TestNG-6.11.patch | 46 +++--- 0004-Port-to-current-maven-shared-utils.patch | 144 +++++++++--------- maven-surefire.spec | 31 +++- sources | 2 +- 7 files changed, 161 insertions(+), 135 deletions(-) rename 0002-Fix-test-with-doxia-1.7.patch => 0002-Port-to-current-doxia.patch (73%) diff --git a/.gitignore b/.gitignore index c5cf538..ce25d77 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/0001-Maven-3.patch b/0001-Maven-3.patch index 28869a1..226a4ab 100644 --- a/0001-Maven-3.patch +++ b/0001-Maven-3.patch @@ -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 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 diff --git a/0002-Fix-test-with-doxia-1.7.patch b/0002-Port-to-current-doxia.patch similarity index 73% rename from 0002-Fix-test-with-doxia-1.7.patch rename to 0002-Port-to-current-doxia.patch index e99664a..5567555 100644 --- a/0002-Fix-test-with-doxia-1.7.patch +++ b/0002-Port-to-current-doxia.patch @@ -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 -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 diff --git a/0003-Port-to-TestNG-6.11.patch b/0003-Port-to-TestNG-6.11.patch index 0519022..2667817 100644 --- a/0003-Port-to-TestNG-6.11.patch +++ b/0003-Port-to-TestNG-6.11.patch @@ -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 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 @@ - - org.testng - testng -- 5.10 -- jdk15 -+ 6.11 - provided - - + + 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 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 diff --git a/0004-Port-to-current-maven-shared-utils.patch b/0004-Port-to-current-maven-shared-utils.patch index 073a808..6e23538 100644 --- a/0004-Port-to-current-maven-shared-utils.patch +++ b/0004-Port-to-current-maven-shared-utils.patch @@ -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 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 systemProperties ) -+ private static void showProperties( XMLWriter xmlWriter, Map systemProperties ) throws IOException - { - xmlWriter.startElement( "properties" ); - for ( final Entry entry : systemProperties.entrySet() ) + * + * @param xmlWriter The test suite to report to + */ +- private static void showProperties( XMLWriter xmlWriter, Map systemProperties ) ++ private static void showProperties( XMLWriter xmlWriter, Map systemProperties ) throws IOException + { + xmlWriter.startElement( "properties" ); + for ( final Entry 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 @@ - 3.5 - 3.5 - 2.5 -- 0.9 -+ 3.2.1 - 2.0.0-beta.5 - scm:git:https://git-wip-us.apache.org/repos/asf/maven-surefire.git - surefire-archives/surefire-LATEST + 3.5 + 3.5 + 2.5 +- 0.9 ++ 3.2.1 + 2.0.0-beta.5 + scm:git:https://gitbox.apache.org/repos/asf/maven-surefire.git + surefire-archives/surefire-LATEST -- -2.14.3 +2.17.1 diff --git a/maven-surefire.spec b/maven-surefire.spec index 5a0e285..65b3be1 100644 --- a/maven-surefire.spec +++ b/maven-surefire.spec @@ -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 - 0:2.22.0-1 +- Update to upstream version 2.22.0 + * Fri Mar 16 2018 Michael Simacek - 0:2.21.0-1 - Update to upstream version 2.21.0 diff --git a/sources b/sources index 194bd2d..f8c375b 100644 --- a/sources +++ b/sources @@ -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