Port to latest surefire

This commit is contained in:
Mat Booth 2017-10-11 17:10:59 +01:00
parent 2246c01bf2
commit f134f86115
3 changed files with 64 additions and 48 deletions

View File

@ -79,19 +79,6 @@ index b00c344..bc05c2d 100644
validateUniqueBaseDirs(projects);
}
diff --git a/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/src/main/java/org/eclipse/tycho/surefire/osgibooter/OsgiSurefireBooter.java b/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/src/main/java/org/eclipse/tycho/surefire/osgibooter/OsgiSurefireBooter.java
index 26afcd4..19eeab9 100644
--- a/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/src/main/java/org/eclipse/tycho/surefire/osgibooter/OsgiSurefireBooter.java
+++ b/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/src/main/java/org/eclipse/tycho/surefire/osgibooter/OsgiSurefireBooter.java
@@ -84,7 +84,7 @@ public class OsgiSurefireBooter {
extractProviderProperties(testProps), null, false);
StartupReportConfiguration startupReportConfig = new StartupReportConfiguration(useFile, printSummary,
StartupReportConfiguration.PLAIN_REPORT_FORMAT, redirectTestOutputToFile, disableXmlReport, reportsDir,
- trimStacktrace, null, "TESTHASH", false);
+ trimStacktrace, null, "TESTHASH", false, 0);
ReporterFactory reporterFactory = new DefaultReporterFactory(startupReportConfig);
// API indicates we should use testClassLoader below but surefire also tries
// to load surefire classes using this classloader
diff --git a/tycho-testing-harness/src/main/java/org/eclipse/tycho/test/AbstractTychoIntegrationTest.java b/tycho-testing-harness/src/main/java/org/eclipse/tycho/test/AbstractTychoIntegrationTest.java
index 097bdeb..f90b10c 100644
--- a/tycho-testing-harness/src/main/java/org/eclipse/tycho/test/AbstractTychoIntegrationTest.java

View File

@ -38,7 +38,7 @@ index c43cc8d..6e5fde4 100644
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.17</version>
+ <version>2.19.1</version>
+ <version>2.20.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@ -53,8 +53,8 @@ index da31140..fb5803f 100644
-Require-Bundle: org.junit;bundle-version="[3.8.0,4.0.0)"
-Bundle-ClassPath: jars/surefire-junit3-2.17.jar
+Require-Bundle: org.junit;bundle-version="[3.8.0,5.0.0)"
+Bundle-ClassPath: jars/surefire-junit3-2.19.1.jar,
+ jars/common-junit3-2.19.1.jar
+Bundle-ClassPath: jars/surefire-junit3-2.20.1.jar,
+ jars/common-junit3-2.20.1.jar
Bundle-Vendor: %providerName
diff --git a/tycho-surefire/org.eclipse.tycho.surefire.junit/pom.xml b/tycho-surefire/org.eclipse.tycho.surefire.junit/pom.xml
index f99c319..0224cc6 100644
@ -81,9 +81,9 @@ index 50be5ea..97760e2 100644
Bundle-RequiredExecutionEnvironment: J2SE-1.5,
JavaSE-1.6
-Bundle-ClassPath: jars/surefire-junit4-2.17.jar
+Bundle-ClassPath: jars/surefire-junit4-2.19.1.jar,
+ jars/common-junit3-2.19.1.jar,
+ jars/common-junit4-2.19.1.jar
+Bundle-ClassPath: jars/surefire-junit4-2.20.1.jar,
+ jars/common-junit3-2.20.1.jar,
+ jars/common-junit4-2.20.1.jar
Import-Package: junit.framework;version="3.0.0",
org.junit;version="4.0.0",
org.junit.runner;version="4.0.0",
@ -122,11 +122,11 @@ index 595265b..1ac6c5d 100644
- jars/surefire-junit47-2.17.jar,
- jars/common-junit48-2.17.jar,
- jars/surefire-grouper-2.17.jar
+ jars/surefire-junit47-2.19.1.jar,
+ jars/common-junit48-2.19.1.jar,
+ jars/surefire-grouper-2.19.1.jar,
+ jars/common-junit3-2.19.1.jar,
+ jars/common-junit4-2.19.1.jar
+ jars/surefire-junit47-2.20.1.jar,
+ jars/common-junit48-2.20.1.jar,
+ jars/surefire-grouper-2.20.1.jar,
+ jars/common-junit3-2.20.1.jar,
+ jars/common-junit4-2.20.1.jar
Import-Package: junit.framework;version="3.0.0",
org.junit;version="[4.7,5)",
org.junit.runner;version="[4.7,5)",
@ -155,16 +155,17 @@ diff --git a/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/META-INF/MANIF
index 991edc1..83732d5 100644
--- a/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/META-INF/MANIFEST.MF
+++ b/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/META-INF/MANIFEST.MF
@@ -5,9 +5,10 @@ Require-Bundle: org.eclipse.osgi;bundle-version="3.2.2",
@@ -5,9 +5,11 @@ Require-Bundle: org.eclipse.osgi;bundle-version="3.2.2",
Eclipse-AutoStart: true
Bundle-Version: 1.0.0
Bundle-ClassPath: .,
- jars/surefire-booter-2.17.jar,
- jars/surefire-api-2.17.jar,
- jars/maven-surefire-common-2.17.jar
+ jars/surefire-booter-2.19.1.jar,
+ jars/surefire-api-2.19.1.jar,
+ jars/maven-surefire-common-2.19.1.jar,
+ jars/surefire-booter-2.20.1.jar,
+ jars/surefire-api-2.20.1.jar,
+ jars/surefire-logger-api-2.20.1.jar,
+ jars/maven-surefire-common-2.20.1.jar,
+ jars/plexus-utils-3.0.jar
Bundle-Name: Tycho Surefire OSGi Booter Eclipse Application
Bundle-ManifestVersion: 2
@ -173,7 +174,19 @@ diff --git a/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/pom.xml b/tych
index 82700eb..3fbc3a3 100644
--- a/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/pom.xml
+++ b/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/pom.xml
@@ -57,6 +57,11 @@
@@ -49,6 +49,11 @@
</artifactItem>
<artifactItem>
<groupId>org.apache.maven.surefire</groupId>
+ <artifactId>surefire-logger-api</artifactId>
+ <version>${surefire-version}</version>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-booter</artifactId>
<version>${surefire-version}</version>
</artifactItem>
@@ -57,6 +62,11 @@
<artifactId>maven-surefire-common</artifactId>
<version>${surefire-version}</version>
</artifactItem>
@ -189,7 +202,7 @@ diff --git a/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/src/main/java/
index 19eeab9..31e9d3e 100644
--- a/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/src/main/java/org/eclipse/tycho/surefire/osgibooter/OsgiSurefireBooter.java
+++ b/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/src/main/java/org/eclipse/tycho/surefire/osgibooter/OsgiSurefireBooter.java
@@ -21,7 +21,9 @@
@@ -21,13 +21,16 @@
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
@ -199,7 +212,14 @@ index 19eeab9..31e9d3e 100644
import java.util.List;
import java.util.Map;
import java.util.Properties;
@@ -36,12 +38,15 @@
import java.util.Set;
import org.apache.maven.plugin.surefire.StartupReportConfiguration;
+import org.apache.maven.plugin.surefire.log.api.NullConsoleLogger;
import org.apache.maven.plugin.surefire.report.DefaultReporterFactory;
import org.apache.maven.surefire.booter.BooterConstants;
import org.apache.maven.surefire.booter.ClassLoaderConfiguration;
@@ -36,12 +39,15 @@
import org.apache.maven.surefire.booter.PropertiesWrapper;
import org.apache.maven.surefire.booter.ProviderConfiguration;
import org.apache.maven.surefire.booter.ProviderFactory;
@ -215,7 +235,7 @@ index 19eeab9..31e9d3e 100644
import org.apache.maven.surefire.testset.TestRequest;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
@@ -62,7 +67,11 @@
@@ -62,7 +68,11 @@
File reportsDir = new File(testProps.getProperty("reportsdirectory"));
String provider = testProps.getProperty("testprovider");
String runOrder = testProps.getProperty("runOrder");
@ -228,7 +248,7 @@ index 19eeab9..31e9d3e 100644
List<String> suiteXmlFiles = wrapper.getStringList(BooterConstants.TEST_SUITE_XML_FILES);
boolean forkRequested = true;
@@ -79,13 +88,14 @@
@@ -79,17 +89,18 @@
new ClassLoaderConfiguration(useSystemClassloader, useManifestOnlyJar), forkRequested, inForkedVM);
// TODO dir scanning with no includes done here (done in TestMojo already)
// but without dirScannerParams we get an NPE accessing runOrder
@ -243,11 +263,17 @@ index 19eeab9..31e9d3e 100644
new RunOrderParameters(runOrder, null), failIfNoTests, reporterConfig, null, testRequest,
- extractProviderProperties(testProps), null, false);
+ extractProviderProperties(testProps), null, false, Collections.<CommandLineOption>emptyList(),
+ 0, Shutdown.DEFAULT);
+ 0, Shutdown.DEFAULT, 0);
StartupReportConfiguration startupReportConfig = new StartupReportConfiguration(useFile, printSummary,
StartupReportConfiguration.PLAIN_REPORT_FORMAT, redirectTestOutputToFile, disableXmlReport, reportsDir,
trimStacktrace, null, "TESTHASH", false, 0);
@@ -107,12 +117,12 @@
- trimStacktrace, null, "TESTHASH", false);
- ReporterFactory reporterFactory = new DefaultReporterFactory(startupReportConfig);
+ trimStacktrace, null, new File(reportsDir, "TESTHASH"), false, 0, null);
+ ReporterFactory reporterFactory = new DefaultReporterFactory(startupReportConfig, new NullConsoleLogger());
// API indicates we should use testClassLoader below but surefire also tries
// to load surefire classes using this classloader
RunResult result = ProviderFactory.invokeProvider(null, createCombinedClassLoader(testPlugin), reporterFactory,
@@ -107,12 +118,12 @@
/*
* See TestMojo#mergeProviderProperties
*/
@ -272,7 +298,7 @@ index cb2b826..bbe5f29 100644
<properties>
- <surefire-version>2.17</surefire-version>
+ <surefire-version>2.19.1</surefire-version>
+ <surefire-version>2.20.1</surefire-version>
<!-- NOTE: when updating surefire version above, run BND manually to find Import-Package
statements to JUnit packages required for org.eclipse.tycho.surefire.junit* OSGi wrappers.
Surefire jars are shaded but not fully self-contained (various package dependencies to org.apache.maven.*
@ -280,7 +306,7 @@ diff --git a/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tych
index 9f1e332..62a16fb 100644
--- a/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/TestMojo.java
+++ b/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/TestMojo.java
@@ -20,6 +20,7 @@
@@ -21,6 +21,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@ -288,7 +314,7 @@ index 9f1e332..62a16fb 100644
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -47,6 +48,7 @@
@@ -48,6 +49,7 @@
import org.apache.maven.surefire.booter.BooterConstants;
import org.apache.maven.surefire.booter.PropertiesWrapper;
import org.apache.maven.surefire.booter.ProviderParameterNames;
@ -296,7 +322,7 @@ index 9f1e332..62a16fb 100644
import org.apache.maven.surefire.util.DefaultScanResult;
import org.apache.maven.surefire.util.ScanResult;
import org.apache.maven.toolchain.Toolchain;
@@ -864,7 +866,7 @@
@@ -865,7 +867,7 @@
}
private void createSurefireProperties(TestFrameworkProvider provider) throws MojoExecutionException {
@ -305,7 +331,7 @@ index 9f1e332..62a16fb 100644
wrapper.setProperty("testpluginname", getTestBundleSymbolicName());
wrapper.setProperty("testclassesdirectory", testClassesDirectory.getAbsolutePath());
wrapper.setProperty("reportsdirectory", reportsDirectory.getAbsolutePath());
@@ -872,8 +874,10 @@
@@ -873,8 +875,10 @@
wrapper.setProperty("failifnotests", String.valueOf(failIfNoTests));
wrapper.setProperty("runOrder", runOrder);
@ -318,7 +344,7 @@ index 9f1e332..62a16fb 100644
ScanResult scanResult = scanForTests();
scanResult.writeTo(mergedProviderProperties);
for (Map.Entry<?, ?> entry : mergedProviderProperties.entrySet()) {
@@ -907,6 +911,24 @@
@@ -911,6 +915,24 @@
return result;
}
@ -343,7 +369,7 @@ index 9f1e332..62a16fb 100644
protected ScanResult scanForTests() {
List<String> defaultIncludes = Arrays.asList("**/Test*.class", "**/*Test.class", "**/*TestCase.class");
List<String> defaultExcludes = Arrays.asList("**/*$*");
@@ -932,12 +954,20 @@
@@ -936,12 +958,20 @@
} else {
excludeList = defaultExcludes;
}
@ -376,10 +402,10 @@ index 9f1e332..62a16fb 100644
- jars/surefire-testng-utils-2.17.jar,
- jars/surefire-grouper-2.17.jar,
- jars/common-java5-2.17.jar
+ jars/surefire-testng-2.19.1.jar,
+ jars/surefire-testng-utils-2.19.1.jar,
+ jars/surefire-grouper-2.19.1.jar,
+ jars/common-java5-2.19.1.jar
+ jars/surefire-testng-2.20.1.jar,
+ jars/surefire-testng-utils-2.20.1.jar,
+ jars/surefire-grouper-2.20.1.jar,
+ jars/common-java5-2.20.1.jar
Import-Package: org.testng,
org.testng.xml
Bundle-Vendor: %providerName

View File

@ -25,7 +25,7 @@
Name: tycho
Version: 1.0.0
Release: 8%{?dist}
Release: 9%{?dist}
Summary: Plugins and extensions for building Eclipse plugins and OSGI bundles with Maven
# license file is missing but all files having some licensing information are ASL 2.0
@ -361,6 +361,9 @@ ln -s %{_javadir}/tycho/org.fedoraproject.p2.jar %{buildroot}%{_datadir}/xmvn/li
%files javadoc -f .mfiles-javadoc
%changelog
* Wed Oct 11 2017 Mat Booth <mat.booth@redhat.com> - 1.0.0-9
- Port to latest surefire
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild