[prev in list] [next in list] [prev in thread] [next in thread]
List: maven-dev
Subject: [maven-surefire] 03/03: [SUREFIRE-1889] Support Java 16 in Surefire Integration Tests
From: tibordigana () apache ! org
Date: 2021-02-28 19:48:06
Message-ID: 20210228194804.0DDDF816C8 () gitbox ! apache ! org
[Download RAW message or body]
This is an automated email from the ASF dual-hosted git repository.
tibordigana pushed a commit to branch jdk16
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git
commit 9f7adbeb5e54cab7036c1055199c38f8dcfad07b
Author: tibordigana <tibor.digana@gmail.com>
AuthorDate: Sun Feb 28 20:46:44 2021 +0100
[SUREFIRE-1889] Support Java 16 in Surefire Integration Tests
---
Jenkinsfile | 6 +-
README.md | 6 +-
maven-failsafe-plugin/pom.xml | 2 +-
.../src/it/jetty-war-test-failing/pom.xml | 4 +
.../src/it/jetty-war-test-passing/pom.xml | 4 +
.../src/site/apt/developing.apt.vm | 2 +-
.../src/site/apt/examples/cucumber.apt.vm | 8 +-
pom.xml | 75 +++++++++++---
surefire-its/pom.xml | 55 +++++++++-
.../maven/surefire/its/AbstractJigsawIT.java | 111 ---------------------
.../its/CheckTestNgListenerReporterIT.java | 9 ++
.../its/JUnit47RerunFailingTestWithCucumberIT.java | 12 ++-
.../maven/surefire/its/JUnit47WithCucumberIT.java | 25 +++--
.../apache/maven/surefire/its/Java9FullApiIT.java | 20 ++--
.../apache/maven/surefire/its/ModulePathIT.java | 3 +-
.../surefire/its/MultiModuleProjectWithJPMSIT.java | 3 +-
.../org/apache/maven/surefire/its/UmlautDirIT.java | 7 ++
.../AbstractJava9PlusIT.java} | 50 +++++-----
.../maven/surefire/its/fixture/MavenLauncher.java | 37 ++++---
.../fixture/SurefireJUnit4IntegrationTestCase.java | 63 +++++++++++-
.../surefire/its/fixture/SurefireLauncher.java | 58 ++---------
.../surefire/its/fixture/SurefireLauncherTest.java | 3 +-
.../its/jiras/Surefire1158RemoveInfoLinesIT.java | 14 ++-
.../surefire/its/jiras/Surefire1265Java9IT.java | 4 +-
...urefire1534ReuseForksFalseWithJavaModuleIT.java | 4 +-
.../its/jiras/Surefire1570ModularFailsafeIT.java | 12 +--
...urefire1712ExtractedModulenameWithoutASMIT.java | 4 +-
.../surefire/its/jiras/Surefire1733JUnitIT.java | 4 +-
.../surefire/its/jiras/Surefire1733TestngIT.java | 4 +-
.../surefire/its/jiras/Surefire673MockitoIT.java | 10 ++
...Surefire946KillMainProcessInReusableForkIT.java | 3 +-
.../src/test/resources/java9-full-api/pom.xml | 4 +-
.../test/resources/junit-pathWithUmlaut/pom.xml | 1 +
.../src/test/resources/junit47-cucumber/pom.xml | 13 +--
.../org/sample/cucumber/FailingCucumberTest.java | 5 +-
.../test/java/org/sample/cucumber/StepDefs.java | 6 +-
.../org/sample/cucumber/SuccessCucumberTest.java | 5 +-
.../pom.xml | 8 +-
.../org/sample/cucumber/FlakeCucumberTest.java | 3 +-
.../test/java/org/sample/cucumber/StepDefs.java | 6 +-
.../test/resources/surefire-673-mockito/pom.xml | 2 +-
.../surefire-855-failsafe-use-war/pom.xml | 2 +-
surefire-its/src/test/resources/toolchains.xml | 2 +-
surefire-providers/surefire-junit-platform/pom.xml | 1 -
44 files changed, 353 insertions(+), 327 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index c6c70da..540040b 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -33,7 +33,7 @@ properties(
final def oses = ['linux':'ubuntu && !H48', 'windows':'Windows']
final def mavens = env.BRANCH_NAME == 'master' ? ['3.6.x', '3.2.x'] : ['3.6.x']
// all non-EOL versions and the first EA
-final def jdks = [15, 11, 8, 7]
+final def jdks = [16, 11, 8, 7]
final def options = ['-e', '-V', '-B', '-nsu', '-P', 'run-its']
final def goals = ['clean', 'install']
@@ -151,7 +151,7 @@ def buildProcess(String stageKey, String jdkName, String \
jdkTestName, String mvn ]) {
sh '$JAVA_HOME_IT/bin/java -version'
sh 'echo JAVA_HOME=$JAVA_HOME, JAVA_HOME_IT=$JAVA_HOME_IT, \
PATH=$PATH'
- def script = cmd + ['\"-Djdk.home=$JAVA_HOME_IT\"']
+ def script = cmd + ['\"-DjdkHome=$JAVA_HOME_IT\"']
def error = sh(returnStatus: true, script: script.join(' '))
currentBuild.result = error == 0 ? 'SUCCESS' : 'FAILURE'
}
@@ -163,7 +163,7 @@ def buildProcess(String stageKey, String jdkName, String \
jdkTestName, String mvn ]) {
bat '%JAVA_HOME_IT%\\bin\\java -version'
bat 'echo JAVA_HOME=%JAVA_HOME%, JAVA_HOME_IT=%JAVA_HOME_IT%, \
PATH=%PATH%'
- def script = cmd + ['\"-Djdk.home=%JAVA_HOME_IT%\"']
+ def script = cmd + ['\"-DjdkHome=%JAVA_HOME_IT%\"']
def error = bat(returnStatus: true, script: script.join(' '))
currentBuild.result = error == 0 ? 'SUCCESS' : 'FAILURE'
}
diff --git a/README.md b/README.md
index e9c0fba..7be267a 100644
--- a/README.md
+++ b/README.md
@@ -59,13 +59,13 @@ Build the Surefire project using **Maven 3.1.0+** and **JDK \
1.8+**. set MAVEN_OPTS="-server -Xmx256m -XX:MetaspaceSize=128m \
-XX:MaxMetaspaceSize=384m -XX:+UseG1GC -XX:+UseStringDeduplication \
-XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:SoftRefLRUPolicyMSPerMB=50 \
-Djava.awt.headless=true -Dhttps.protocols=TLSv1.2" ```
-* In order to run the tests with **JDK 1.7** (on Linux/Unix modify the system \
property **jdk.home**): +* In order to run the tests with **JDK 1.7** (on \
Linux/Unix modify the system property **jdkHome**): ```
- mvn install site site:stage -P reporting,run-its "-Djdk.home=e:\Program \
Files\Java\jdk1.7.0_80\" + mvn install site site:stage -P reporting,run-its \
"-DjdkHome=e:\Program Files\Java\jdk1.7.0_80\" ```
* In order to run the build and the tests with **JDK 1.8+**, e.g. JDK 11:
```
- mvn install site site:stage -P reporting,run-its "-Djdk.home=e:\Program \
Files\Java\jdk11\" + mvn install site site:stage -P reporting,run-its \
"-DjdkHome=e:\Program Files\Java\jdk11\" ```
diff --git a/maven-failsafe-plugin/pom.xml b/maven-failsafe-plugin/pom.xml
index fcf9677..f9ef2ec 100644
--- a/maven-failsafe-plugin/pom.xml
+++ b/maven-failsafe-plugin/pom.xml
@@ -291,7 +291,7 @@
</execution>
</executions>
<configuration>
- <javaHome>${jdk.home}</javaHome>
+ <javaHome>${jdkHome}</javaHome>
</configuration>
</plugin>
</plugins>
diff --git a/maven-failsafe-plugin/src/it/jetty-war-test-failing/pom.xml \
b/maven-failsafe-plugin/src/it/jetty-war-test-failing/pom.xml index 193791d..997d507 \
100644
--- a/maven-failsafe-plugin/src/it/jetty-war-test-failing/pom.xml
+++ b/maven-failsafe-plugin/src/it/jetty-war-test-failing/pom.xml
@@ -65,6 +65,10 @@
</testResources>
<plugins>
<plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>3.3.1</version>
+ </plugin>
+ <plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty-version}</version>
diff --git a/maven-failsafe-plugin/src/it/jetty-war-test-passing/pom.xml \
b/maven-failsafe-plugin/src/it/jetty-war-test-passing/pom.xml index 31dc8ec..84a8ffe \
100644
--- a/maven-failsafe-plugin/src/it/jetty-war-test-passing/pom.xml
+++ b/maven-failsafe-plugin/src/it/jetty-war-test-passing/pom.xml
@@ -65,6 +65,10 @@
</testResources>
<plugins>
<plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>3.3.1</version>
+ </plugin>
+ <plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty-version}</version>
diff --git a/maven-surefire-plugin/src/site/apt/developing.apt.vm \
b/maven-surefire-plugin/src/site/apt/developing.apt.vm index dcae1d7..7c8ccb2 100644
--- a/maven-surefire-plugin/src/site/apt/developing.apt.vm
+++ b/maven-surefire-plugin/src/site/apt/developing.apt.vm
@@ -119,7 +119,7 @@ ForkedBooter#main
and other modules are compiled with source/target 1.7. The plugin and several \
providers are 1.7. The provider <<<surefire-junit-platform>>> is compiled with \
jdk1.8. The project requires using <<<JAVA_HOME>>> jdk1.8 but the tests run with \
jdk1.7+ which is
- configured by system property <<<jdk.home>>>, see <<<README.md>>>.
+ configured by system property <<<jdkHome>>>, see <<<README.md>>>.
* Provider Isolation
diff --git a/maven-surefire-plugin/src/site/apt/examples/cucumber.apt.vm \
b/maven-surefire-plugin/src/site/apt/examples/cucumber.apt.vm index e0436cc..e211be5 \
100644
--- a/maven-surefire-plugin/src/site/apt/examples/cucumber.apt.vm
+++ b/maven-surefire-plugin/src/site/apt/examples/cucumber.apt.vm
@@ -54,8 +54,8 @@ package org.sample.cucumber;
import org.junit.runner.RunWith;
-import cucumber.api.CucumberOptions;
-import cucumber.api.junit.Cucumber;
+import io.cucumber.junit.CucumberOptions;
+import io.cucumber.junit.Cucumber;
@RunWith( Cucumber.class )
public class RunCucumberTest
@@ -71,8 +71,8 @@ package org.sample.cucumber;
import org.junit.runner.RunWith;
-import cucumber.api.CucumberOptions;
-import cucumber.api.junit.Cucumber;
+import io.cucumber.junit.CucumberOptions;
+import io.cucumber.junit.Cucumber;
@RunWith( Cucumber.class )
public class RunCucumberIT
diff --git a/pom.xml b/pom.xml
index 4505bb5..3e36523 100644
--- a/pom.xml
+++ b/pom.xml
@@ -102,11 +102,9 @@
<jacocoVersion>0.8.6</jacocoVersion>
<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>
- <!-- Override with Jigsaw JRE 9 -->
- <jdk.home>${java.home}/..</jdk.home>
<maven.compiler.testSource>1.${javaVersion}</maven.compiler.testSource>
<maven.compiler.testTarget>1.${javaVersion}</maven.compiler.testTarget>
- <jvm.args.tests>-Xms128m -Xmx144m -XX:SoftRefLRUPolicyMSPerMB=50 \
-Djava.awt.headless=true \
-Djdk.net.URLClassPath.disableClassPathURLCheck=true</jvm.args.tests> + \
<jvm.args.tests>${jvm9ArgsTests} -Xms32m -Xmx144m -XX:SoftRefLRUPolicyMSPerMB=50 \
-Djava.awt.headless=true \
-Djdk.net.URLClassPath.disableClassPathURLCheck=true</jvm.args.tests>
<project.build.outputTimestamp>2020-06-10T18:16:37Z</project.build.outputTimestamp>
</properties>
@@ -452,7 +450,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
- <version>1.12</version>
+ <version>3.2.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -510,12 +508,13 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M4</version> <!-- ${shadedVersion}, but resolved due to \
https://issues.apache.org/jira/browse/MRELEASE-799 --> <configuration>
+ <skipTests>${doSkipTests}</skipTests>
<!-- NOTE: Be sure to isolate the Surefire version under test from the \
version running the tests! --> <useSystemClassLoader>false</useSystemClassLoader>
<argLine>${jvm.args.tests}</argLine><!-- \
-Dnet.bytebuddy.experimental=true ${jacoco.agent}--> <useFile>false</useFile>
<redirectTestOutputToFile>false</redirectTestOutputToFile>
- <jvm>${jdk.home}/bin/java</jvm>
+ <jvm>${jdkHome}/bin/java</jvm>
</configuration>
</plugin>
<plugin>
@@ -659,6 +658,62 @@
<fail>true</fail>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>bsh-property</id>
+ <goals>
+ <goal>bsh-property</goal>
+ </goals>
+ <configuration>
+ <properties>
+ <property>jdkHome</property>
+ <property>doSkipTests</property>
+ <property>jvm9ArgsTests</property>
+ </properties>
+ <source>
+ jdkHome = \
session.getUserProperties().getProperty("jdkHome", \
project.getProperties().getProperty("jdkHome")); + if \
(jdkHome == null || jdkHome.isEmpty()) { + jreHome = \
System.getProperty("java.home"); + jrePath = new \
File(jreHome); + jdkHome = \
"jre".equals(jrePath.getName()) ? jrePath.getParent() : jrePath.getPath(); + \
} + release = new File(jdkHome, "release");
+ System.out.println("Beanshell found jdkHome=" + \
jdkHome); + System.out.println("Beanshell found \
jdk-release properties file=" + release.exists()); + props \
= new Properties(); + reader = new FileReader(release);
+ props.load(reader);
+ reader.close();
+ javaVersion = \
props.getProperty("JAVA_VERSION").replace("\"", ""); + \
System.out.println("Beanshell found java version for tests " + javaVersion); + \
majorJavaVersion = Integer.parseInt(javaVersion.substring(0, \
javaVersion.contains(".") ? javaVersion.indexOf('.') : javaVersion.length())); + \
isSkippedTests = project.getProperties().getProperty("skipTests", \
session.getUserProperties().getProperty("skipTests")); + \
if (isSkippedTests == null) { + isSkippedTests = \
"false"; + }
+
+ skip = isSkippedTests;
+ args = "--add-opens java.base/java.lang=ALL-UNNAMED \
--add-opens java.base/java.math=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED \
--add-opens java.base/java.util=ALL-UNNAMED --add-opens \
java.base/java.text=ALL-UNNAMED --add-opens java.base/java.util.regex=ALL-UNNAMED \
--add-opens java.base/java.nio.channels.spi=ALL-UNNAMED --add-opens \
java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED \
--add-opens java.base/java.util.concurrent=A [...] +
+ if (majorJavaVersion == 1) {
+ isJava7 = javaVersion.matches("^1\\.7.*");
+ skip = \
"surefire-junit-platform".equals(project.getArtifactId()) ? "" + \
(Boolean.parseBoolean(isSkippedTests) || isJava7) : isSkippedTests; + \
args = ""; + }
+
+ doSkipTests = skip;
+ jvm9ArgsTests = args;
+
+ System.out.println("Beanshell doSkipTests=" + \
doSkipTests); + System.out.println("Beanshell \
jvm9ArgsTests=" + jvm9ArgsTests); + </source>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
@@ -730,19 +785,9 @@
</plugins>
</reporting>
</profile>
- <profile>
- <id>jdk9+</id>
- <activation>
- <jdk>[9, )</jdk>
- </activation>
- <properties>
- <jdk.home>${java.home}</jdk.home>
- </properties>
- </profile>
<profile>
<id>apache-release</id>
<build>
-
<!-- after Maven Compiler 3.8.1 is fixed, use maven.compiler.release, \
see SUREFIRE-1820 --> <plugins>
<plugin>
diff --git a/surefire-its/pom.xml b/surefire-its/pom.xml
index 930bbd1..8275230 100644
--- a/surefire-its/pom.xml
+++ b/surefire-its/pom.xml
@@ -543,6 +543,12 @@
\
<configuration><artifact>junit:junit:4.13</artifact></configuration> </execution>
<execution>
+ <id>junit-4.13.1</id>
+ <phase>pre-integration-test</phase>
+ <goals><goal>get</goal></goals>
+ \
<configuration><artifact>junit:junit:4.13.1</artifact></configuration> + \
</execution> + <execution>
<id>junit-dep-4.4</id>
<phase>pre-integration-test</phase>
<goals><goal>get</goal></goals>
@@ -606,13 +612,13 @@
<id>cucumber-java</id>
<phase>pre-integration-test</phase>
<goals><goal>get</goal></goals>
- \
<configuration><artifact>io.cucumber:cucumber-java:2.0.0</artifact></configuration> + \
<configuration><artifact>io.cucumber:cucumber-java:6.10.0</artifact></configuration> \
</execution> <execution>
<id>cucumber-junit</id>
<phase>pre-integration-test</phase>
<goals><goal>get</goal></goals>
- \
<configuration><artifact>io.cucumber:cucumber-junit:2.0.0</artifact></configuration> \
+ \
<configuration><artifact>io.cucumber:cucumber-junit:6.10.0</artifact></configuration> \
</execution> <execution>
<id>vintage-5.1.1</id>
@@ -705,6 +711,48 @@
\
<configuration><artifact>org.junit.jupiter:junit-jupiter-engine:5.6.2</artifact></configuration>
</execution>
<execution>
+ <id>jupiter-5.7.1</id>
+ <phase>pre-integration-test</phase>
+ <goals><goal>get</goal></goals>
+ \
<configuration><artifact>org.junit.jupiter:junit-jupiter-engine:5.7.1</artifact></configuration>
+ </execution>
+ <execution>
+ <id>jqwik-0.8.0</id>
+ <phase>pre-integration-test</phase>
+ <goals><goal>get</goal></goals>
+ \
<configuration><artifact>net.jqwik:jqwik:0.8.0</artifact></configuration> + \
</execution> + <execution>
+ <id>jqwik-0.9.0</id>
+ <phase>pre-integration-test</phase>
+ <goals><goal>get</goal></goals>
+ \
<configuration><artifact>net.jqwik:jqwik:0.9.0</artifact></configuration> + \
</execution> + <execution>
+ <id>jqwik-1.0.0</id>
+ <phase>pre-integration-test</phase>
+ <goals><goal>get</goal></goals>
+ \
<configuration><artifact>net.jqwik:jqwik:1.0.0</artifact></configuration> + \
</execution> + <execution>
+ <id>jqwik-0.8.15</id>
+ <phase>pre-integration-test</phase>
+ <goals><goal>get</goal></goals>
+ \
<configuration><artifact>net.jqwik:jqwik:0.8.15</artifact></configuration> + \
</execution> + <execution>
+ <id>jqwik-1.2.7</id>
+ <phase>pre-integration-test</phase>
+ <goals><goal>get</goal></goals>
+ \
<configuration><artifact>net.jqwik:jqwik:1.2.7</artifact></configuration> + \
</execution> + <execution>
+ <id>jqwik-1.5.0</id>
+ <phase>pre-integration-test</phase>
+ <goals><goal>get</goal></goals>
+ \
<configuration><artifact>net.jqwik:jqwik:1.5.0</artifact></configuration> + \
</execution> + <execution>
<id>crashjvm</id>
<phase>pre-integration-test</phase>
<goals><goal>get</goal></goals>
@@ -720,7 +768,7 @@
<version>3.0.0-M4</version> <!-- ${shadedVersion}, but \
resolved due to https://issues.apache.org/jira/browse/MRELEASE-799 --> \
<configuration> <skipTests>${skipTests}</skipTests>
- <jvm>${jdk.home}/bin/java</jvm>
+ <jvm>${jdkHome}/bin/java</jvm>
<runOrder>alphabetical</runOrder>
<threadCount>1</threadCount>
<perCoreThreadCount>false</perCoreThreadCount>
@@ -738,7 +786,6 @@
\
<maven.toolchains.file>${project.build.directory}/private/toolchains.xml</maven.toolchains.file>
\
<maven.test.tmpdir>${project.build.directory}</maven.test.tmpdir>
<verifier.forkMode>forked</verifier.forkMode>
- <jdk.home>${jdk.home}</jdk.home>
<jacoco.agent>${jacoco-it.agent}</jacoco.agent>
<!-- see the f/w \
com.googlecode.junit-toolbox:junit-toolbox -->
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/AbstractJigsawIT.java \
b/surefire-its/src/test/java/org/apache/maven/surefire/its/AbstractJigsawIT.java \
deleted file mode 100644 index c8fb2d5..0000000
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/AbstractJigsawIT.java
+++ /dev/null
@@ -1,111 +0,0 @@
-package org.apache.maven.surefire.its;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
-import org.apache.maven.surefire.its.fixture.SurefireLauncher;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-import java.util.StringTokenizer;
-
-import static org.apache.maven.surefire.its.fixture.SurefireLauncher.EXT_JDK_HOME;
-import static org.apache.maven.surefire.its.fixture.SurefireLauncher.EXT_JDK_HOME_KEY;
-import static org.junit.Assert.fail;
-import static org.junit.Assume.assumeTrue;
-
-/**
- * Abstract test class for Jigsaw tests.
- *
- * @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
- * @since 2.20.1
- */
-public abstract class AbstractJigsawIT
- extends SurefireJUnit4IntegrationTestCase
-{
- private static final double JIGSAW_JAVA_VERSION = 9.0d;
-
- protected abstract String getProjectDirectoryName();
-
- protected SurefireLauncher assumeJava9() throws IOException
- {
- assumeTrue( "There's no JDK 9 provided.",
- isJavaVersion9AtLeast() || EXT_JDK_HOME != null && \
isExtJavaVerion9AtLeast() );
- // fail( EXT_JDK_HOME_KEY + " was provided with value " + EXT_JDK_HOME + " \
but it is not Jigsaw Java 9." );
-
- SurefireLauncher launcher = unpack();
-
- return EXT_JDK_HOME == null ? launcher : launcher.setLauncherJavaHome( \
EXT_JDK_HOME );
- }
-
- protected SurefireLauncher assumeJava9Property() throws IOException
- {
- assumeTrue( "There's no JDK 9 provided.", EXT_JDK_HOME != null && \
isExtJavaVerion9AtLeast() );
- return unpack();
- }
-
- protected String getSuffix()
- {
- return null;
- }
-
- private SurefireLauncher unpack()
- {
- return unpack( getProjectDirectoryName(), getSuffix() );
- }
-
- private static boolean isJavaVersion9AtLeast()
- {
- return Double.valueOf( System.getProperty( "java.specification.version" ) ) \
>= JIGSAW_JAVA_VERSION;
- }
-
- private static boolean isExtJavaVerion9AtLeast() throws IOException
- {
- File release = new File( EXT_JDK_HOME, "release" );
- assumeTrue( EXT_JDK_HOME_KEY + " was provided with value " + EXT_JDK_HOME + \
" but file does not exist "
- + EXT_JDK_HOME + File.separator + "release", release.exists() );
-
- Properties properties = new Properties();
- try ( InputStream is = new FileInputStream( release ) )
- {
- properties.load( is );
- }
- String javaVersion = properties.getProperty( "JAVA_VERSION" ).replace( "\"", \
"" );
- StringTokenizer versions = new StringTokenizer( javaVersion, "._" );
-
- if ( versions.countTokens() == 1 )
- {
- javaVersion = versions.nextToken();
- }
- else if ( versions.countTokens() >= 2 )
- {
- javaVersion = versions.nextToken() + "." + versions.nextToken();
- }
- else
- {
- fail( "unexpected java version format" );
- }
-
- return Double.valueOf( javaVersion ) >= JIGSAW_JAVA_VERSION;
- }
-}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgListenerReporterIT.java \
b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgListenerReporterIT.java
index d1595e9..8bd3801 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgListenerReporterIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgListenerReporterIT.java
@@ -29,6 +29,7 @@ import java.util.Arrays;
import java.util.Collection;
import static org.apache.maven.surefire.its.fixture.HelperAssertions.assumeJavaVersion;
+import static org.apache.maven.surefire.its.fixture.HelperAssertions.assumeJavaVersionExcluded;
import static org.junit.runners.Parameterized.Parameter;
import static org.junit.runners.Parameterized.Parameters;
@@ -94,6 +95,14 @@ public class CheckTestNgListenerReporterIT
public void testNgListenerReporter()
{
assumeJavaVersion( javaVersion );
+
+ if ( version.equals( "5.13" ) )
+ {
+ // only 5.13 uses Google Guice, reflection which breaks jdk 16+
+ // module java.base does not "opens java.lang" to unnamed module \
@209c0b14 + assumeJavaVersionExcluded( 16 );
+ }
+
final SurefireLauncher launcher = unpack( "testng-listener-reporter", "_" + \
version )
.sysProp( "testNgVersion", version \
);
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47RerunFailingTestWithCucumberIT.java \
b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47RerunFailingTestWithCucumberIT.java
index 94a33c6..932fc18 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47RerunFailingTestWithCucumberIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47RerunFailingTestWithCucumberIT.java
@@ -22,6 +22,7 @@ package org.apache.maven.surefire.its;
import com.googlecode.junittoolbox.ParallelParameterized;
import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.apache.maven.surefire.its.fixture.SurefireLauncher;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized.Parameter;
@@ -29,6 +30,7 @@ import org.junit.runners.Parameterized.Parameters;
import java.util.ArrayList;
+import static org.apache.maven.surefire.its.fixture.HelperAssertions.assumeJavaVersion;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
@@ -40,6 +42,7 @@ import static org.hamcrest.Matchers.equalTo;
* @author mpkorstanje
*/
@RunWith( ParallelParameterized.class )
+@SuppressWarnings( "checkstyle:magicnumber" )
public class JUnit47RerunFailingTestWithCucumberIT extends \
SurefireJUnit4IntegrationTestCase {
private static final String LEGACY_FORK_NODE =
@@ -48,6 +51,12 @@ public class JUnit47RerunFailingTestWithCucumberIT extends \
SurefireJUnit4Integra private static final String SUREFIRE_FORK_NODE =
"org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory";
+ @Before
+ public void assumeJava8Plus()
+ {
+ assumeJavaVersion( 1.8d );
+ }
+
@Parameters
public static Iterable<Object[]> data()
{
@@ -64,8 +73,7 @@ public class JUnit47RerunFailingTestWithCucumberIT extends \
SurefireJUnit4Integra private SurefireLauncher unpack()
{
SurefireLauncher launcher =
- unpack( "junit47-rerun-failing-tests-with-cucumber", profileId == null ? \
"" : "-" + profileId )
- .setJUnitVersion( "4.13" );
+ unpack( "junit47-rerun-failing-tests-with-cucumber", profileId == null ? \
"" : "-" + profileId );
if ( profileId != null )
{
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47WithCucumberIT.java \
b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47WithCucumberIT.java \
index 4b99df5..bced252 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47WithCucumberIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47WithCucumberIT.java
@@ -20,8 +20,11 @@ package org.apache.maven.surefire.its;
*/
import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
+import org.junit.Before;
import org.junit.Test;
+import static org.apache.maven.surefire.its.fixture.HelperAssertions.assumeJavaVersion;
+
/**
* Tests the JUnit 47 provider with the cucumber runner. At the moment, they don't \
play along that perfectly (minor
* glitches in the reports with parallel=classes), but at least all tests are \
executed, the execution times are counted @@ -30,32 +33,34 @@ import org.junit.Test;
*
* @author agudian
*/
+@SuppressWarnings( "checkstyle:magicnumber" )
public class JUnit47WithCucumberIT
extends SurefireJUnit4IntegrationTestCase
{
+ @Before
+ public void assumeJava8Plus()
+ {
+ assumeJavaVersion( 1.8d );
+ }
@Test
public void testWithoutParallel()
{
- // 8 tests in total is what's probably correct
- doTest( "none", 8 );
+ doTest( "none" );
}
@Test
public void testWithParallelClasses()
{
- // with parallel=classes, we get 9 tests in total,
- // as the dummy "scenario" test entry is reported twice: once as success, \
and once with the failure from the
- // failing test step
- doTest( "classes", 9 );
+ doTest( "classes" );
}
- private void doTest( String parallel, int total )
+ private void doTest( String parallel )
{
unpack( "junit47-cucumber" )
- .sysProp( "parallel", parallel )
- .sysProp( "threadCount", "2" )
+ .parallel( parallel )
+ .threadCount( 2 )
.executeTest()
- .assertTestSuiteResults( total, 0, 2, 0 );
+ .assertTestSuiteResults( 2, 0, 1, 0 );
}
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/Java9FullApiIT.java \
b/surefire-its/src/test/java/org/apache/maven/surefire/its/Java9FullApiIT.java index \
37b784b..f326e1d 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/Java9FullApiIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/Java9FullApiIT.java
@@ -19,13 +19,10 @@ package org.apache.maven.surefire.its;
* under the License.
*/
+import org.apache.maven.surefire.its.fixture.AbstractJava9PlusIT;
import org.apache.maven.surefire.its.fixture.OutputValidator;
import org.junit.Test;
-import java.io.File;
-
-import static org.apache.maven.surefire.its.fixture.SurefireLauncher.EXT_JDK_HOME;
-import static org.apache.maven.surefire.its.fixture.SurefireLauncher.EXT_JDK_HOME_KEY;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
import static org.hamcrest.Matchers.is;
@@ -37,10 +34,8 @@ import static org.hamcrest.Matchers.is;
* @since 2.20.1
*/
public class Java9FullApiIT
- extends AbstractJigsawIT
+ extends AbstractJava9PlusIT
{
- private static final String JVM_SPEC_VERSION = System.getProperty( \
"java.specification.version" );
-
@Test
@SuppressWarnings( "checkstyle:methodname" )
public void shouldLoadMultipleJavaModules_JavaHome() throws Exception
@@ -56,7 +51,7 @@ public class Java9FullApiIT
.verifyTextInLog( "loaded class javax.xml.bind.JAXBException" )
.verifyTextInLog( "loaded class \
javax.transaction.TransactionManager" )
.verifyTextInLog( "loaded class \
javax.transaction.InvalidTransactionException" )
- .assertThatLogLine( is( "java.specification.version=" + \
JVM_SPEC_VERSION ), + .assertThatLogLine( is( \
"java.specification.version=" + (int) JAVA_VERSION ), greaterThanOrEqualTo( 1 ) );
}
@@ -64,10 +59,9 @@ public class Java9FullApiIT
@SuppressWarnings( "checkstyle:methodname" )
public void shouldLoadMultipleJavaModules_JvmParameter() throws Exception
{
- OutputValidator validator = assumeJava9Property()
+ OutputValidator validator = assumeJava9()
.setForkJvm()
.debugLogging()
- .sysProp( EXT_JDK_HOME_KEY, new File( \
EXT_JDK_HOME ).getCanonicalPath() )
.execute( "verify" )
.verifyErrorFree( 1 );
@@ -76,7 +70,7 @@ public class Java9FullApiIT
.verifyTextInLog( "loaded class javax.xml.bind.JAXBException" )
.verifyTextInLog( "loaded class \
javax.transaction.TransactionManager" )
.verifyTextInLog( "loaded class \
javax.transaction.InvalidTransactionException" )
- .assertThatLogLine( is( "java.specification.version=" + \
JVM_SPEC_VERSION ), + .assertThatLogLine( is( \
"java.specification.version=" + (int) JAVA_VERSION ), greaterThanOrEqualTo( 1 ) );
}
@@ -84,7 +78,7 @@ public class Java9FullApiIT
@SuppressWarnings( "checkstyle:methodname" )
public void shouldLoadMultipleJavaModules_ToolchainsXML() throws Exception
{
- OutputValidator validator = assumeJava9Property()
+ OutputValidator validator = assumeJava9()
.setForkJvm()
.activateProfile( "use-toolchains" )
.addGoal( "--toolchains" )
@@ -97,7 +91,7 @@ public class Java9FullApiIT
.verifyTextInLog( "loaded class javax.xml.bind.JAXBException" )
.verifyTextInLog( "loaded class \
javax.transaction.TransactionManager" )
.verifyTextInLog( "loaded class \
javax.transaction.InvalidTransactionException" )
- .assertThatLogLine( is( "java.specification.version=" + \
JVM_SPEC_VERSION ), + .assertThatLogLine( is( \
"java.specification.version=" + (int) JAVA_VERSION ), greaterThanOrEqualTo( 1 ) );
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/ModulePathIT.java \
b/surefire-its/src/test/java/org/apache/maven/surefire/its/ModulePathIT.java index \
5a716ca..c04a1ea 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/ModulePathIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/ModulePathIT.java
@@ -19,6 +19,7 @@ package org.apache.maven.surefire.its;
* under the License.
*/
+import org.apache.maven.surefire.its.fixture.AbstractJava9PlusIT;
import org.junit.Test;
import java.io.IOException;
@@ -27,7 +28,7 @@ import java.io.IOException;
*
*/
public class ModulePathIT
- extends AbstractJigsawIT
+ extends AbstractJava9PlusIT
{
private String suffix;
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/MultiModuleProjectWithJPMSIT.java \
b/surefire-its/src/test/java/org/apache/maven/surefire/its/MultiModuleProjectWithJPMSIT.java
index 8b011ae..ac563b1 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/MultiModuleProjectWithJPMSIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/MultiModuleProjectWithJPMSIT.java
@@ -19,6 +19,7 @@ package org.apache.maven.surefire.its;
* under the License.
*/
+import org.apache.maven.surefire.its.fixture.AbstractJava9PlusIT;
import org.apache.maven.surefire.its.fixture.OutputValidator;
import org.junit.Test;
@@ -31,7 +32,7 @@ import static org.hamcrest.Matchers.is;
/**
* Integration test for <a \
href="https://issues.apache.org/jira/browse/SUREFIRE-1733">SUREFIRE-1733</a>.
*/
-public class MultiModuleProjectWithJPMSIT extends AbstractJigsawIT
+public class MultiModuleProjectWithJPMSIT extends AbstractJava9PlusIT
{
@Test
public void test() throws Exception
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/UmlautDirIT.java \
b/surefire-its/src/test/java/org/apache/maven/surefire/its/UmlautDirIT.java index \
e0095e0..8bcdfd4 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/UmlautDirIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/UmlautDirIT.java
@@ -33,6 +33,7 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
+import static org.apache.maven.surefire.its.fixture.HelperAssertions.assumeJavaVersionExcluded;
import static java.nio.file.Files.copy;
import static java.nio.file.Files.createDirectories;
import static java.nio.file.Files.exists;
@@ -53,6 +54,12 @@ public class UmlautDirIT extends SurefireJUnit4IntegrationTestCase
@Before
public void backupLocalRepo()
{
+ // We touched the Javac bug, see the discussion [1].
+ // The fix [2] will be in Java 17, not in Java 16. So we cannot use Java 16 \
then! + // [1]: \
http://ant.1045680.n5.nabble.com/JDK-16-is-in-Rampdown-Phase-One-td5720549.html#a5720552
+ // [2]: https://bugs.openjdk.java.net/browse/JDK-8258246
+ assumeJavaVersionExcluded( 16 );
+
localRepo = System.getProperty( "maven.repo.local" );
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/ModulePathIT.java \
b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/AbstractJava9PlusIT.java
similarity index 51%
copy from surefire-its/src/test/java/org/apache/maven/surefire/its/ModulePathIT.java
copy to surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/AbstractJava9PlusIT.java
index 5a716ca..c9c6225 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/ModulePathIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/AbstractJava9PlusIT.java
@@ -1,4 +1,4 @@
-package org.apache.maven.surefire.its;
+package org.apache.maven.surefire.its.fixture;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -19,50 +19,46 @@ package org.apache.maven.surefire.its;
* under the License.
*/
-import org.junit.Test;
-
import java.io.IOException;
+import static org.junit.Assume.assumeTrue;
+
/**
+ * Abstract test class for Jigsaw tests.
*
+ * @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
+ * @since 2.20.1
*/
-public class ModulePathIT
- extends AbstractJigsawIT
+public abstract class AbstractJava9PlusIT
+ extends SurefireJUnit4IntegrationTestCase
{
- private String suffix;
+ protected abstract String getProjectDirectoryName();
- @Test
- public void testModulePath()
- throws IOException
+ protected SurefireLauncher assumeJava9() throws IOException
{
- assumeJava9()
- .debugLogging()
- .executeTest()
- .verifyErrorFreeLog()
- .assertTestSuiteResults( 2 );
+ assumeTrue( "There's no JDK 9 provided.", IS_JAVA9_PLUS );
+ return unpack();
}
- @Test
- public void testModulePathWithSpaces()
- throws IOException
+ protected String getSuffix()
{
- suffix = " with spaces";
- assumeJava9()
- .debugLogging()
- .executeTest()
- .verifyErrorFreeLog()
- .assertTestSuiteResults( 2 );
+ return null;
}
@Override
- protected String getProjectDirectoryName()
+ public final SurefireLauncher unpack( String sourceName )
{
- return "modulepath";
+ throw new UnsupportedOperationException();
}
@Override
- protected String getSuffix()
+ public final SurefireLauncher unpack( String sourceName, String suffix )
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ private SurefireLauncher unpack()
{
- return suffix;
+ return unpack( getClass(), getProjectDirectoryName(), getSuffix() );
}
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/MavenLauncher.java \
b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/MavenLauncher.java \
index d444e35..112acf6 100755
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/MavenLauncher.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/MavenLauncher.java
@@ -29,10 +29,13 @@ import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
+import java.util.Map.Entry;
+import static java.util.Collections.singletonMap;
import static java.util.Collections.unmodifiableList;
/**
@@ -51,6 +54,8 @@ public final class MavenLauncher
private final Map<String, String> envVars = new HashMap<>();
+ private final Map<String, String> props = new LinkedHashMap<>();
+
private File unpackedAt;
private Verifier verifier;
@@ -293,8 +298,17 @@ public final class MavenLauncher
{
try
{
+ List<String> goalsAndProps = new ArrayList<>( goals );
+
+ for ( Entry<String, String> e : props.entrySet() )
+ {
+ String key = e.getKey();
+ String val = e.getValue();
+ goalsAndProps.add( val == null ? "-D" + key : "-D" + key + "=" + val \
); + }
+
getVerifier().setCliOptions( cliOptions );
- getVerifier().executeGoals( goals, envVars );
+ getVerifier().executeGoals( goalsAndProps, envVars );
return getValidator();
}
catch ( VerificationException e )
@@ -312,33 +326,30 @@ public final class MavenLauncher
return addGoal( "-P" + profile );
}
- public MavenLauncher sysProp( String variable, String value )
+ public MavenLauncher sysProp( String key, String value )
{
- return addGoal( "-D" + variable + "=" + value );
+ return sysProp( singletonMap( key, value ) );
}
public MavenLauncher sysProp( Map<String, String> properties )
{
- for ( Map.Entry<String, String> property : properties.entrySet() )
- {
- sysProp( property.getKey(), property.getValue() );
- }
+ props.putAll( properties );
return this;
}
- public MavenLauncher sysProp( String variable, boolean value )
+ public MavenLauncher sysProp( String key, boolean value )
{
- return addGoal( "-D" + variable + "=" + value );
+ return sysProp( singletonMap( key, Boolean.toString( value ) ) );
}
- public MavenLauncher sysProp( String variable, int value )
+ public MavenLauncher sysProp( String key, int value )
{
- return addGoal( "-D" + variable + "=" + value );
+ return sysProp( singletonMap( key, Integer.toString( value ) ) );
}
- public MavenLauncher sysProp( String variable, double value )
+ public MavenLauncher sysProp( String key, double value )
{
- return addGoal( "-D" + variable + "=" + value );
+ return sysProp( singletonMap( key, Double.toString( value ) ) );
}
public MavenLauncher showExceptionMessages()
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireJUnit4IntegrationTestCase.java \
b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireJUnit4IntegrationTestCase.java
index ee04dbc..8b1dbde 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireJUnit4IntegrationTestCase.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireJUnit4IntegrationTestCase.java
@@ -19,6 +19,11 @@ package org.apache.maven.surefire.its.fixture;
* under the License.
*/
+import java.io.File;
+import java.io.IOException;
+
+import static java.lang.Double.parseDouble;
+
/**
* Contains commonly used features for most tests, encapsulating
* common use cases.
@@ -31,6 +36,14 @@ package org.apache.maven.surefire.its.fixture;
*/
public abstract class SurefireJUnit4IntegrationTestCase
{
+ private static final int JAVA9_VERSION = 9;
+
+ public static final File JAVA_HOME = javaHome();
+
+ public static final double JAVA_VERSION = javaVersion();
+
+ public static final boolean IS_JAVA9_PLUS = isJDK9Plus();
+
public OutputValidator executeErrorFreeTest( String sourceName, int total )
{
return unpack( sourceName ).executeTest().verifyErrorFree( total );
@@ -46,15 +59,57 @@ public abstract class SurefireJUnit4IntegrationTestCase
return unpack( getClass(), sourceName, suffix );
}
- public static SurefireLauncher unpack( Class testClass, String sourceName, \
String suffix, String[] cli ) + public SurefireLauncher unpack( String sourceName, \
String suffix, String[] cli ) {
- MavenLauncher mavenLauncher = new MavenLauncher( testClass, sourceName, \
suffix, cli );
- return new SurefireLauncher( mavenLauncher );
+ return unpack( getClass(), sourceName, suffix, cli );
}
- public static SurefireLauncher unpack( Class testClass, String sourceName, \
String suffix ) + public static SurefireLauncher unpack( Class<?> testClass, \
String sourceName, String suffix ) {
return unpack( testClass, sourceName, suffix, null );
}
+ private static SurefireLauncher unpack( Class<?> testClass, String sourceName, \
String suffix, String[] cli ) + {
+ MavenLauncher mavenLauncher = new MavenLauncher( testClass, sourceName, \
suffix, cli ); + return new SurefireLauncher( mavenLauncher, JAVA_HOME );
+ }
+
+ private static double javaVersion()
+ {
+ return parseDouble( System.getProperty( "java.specification.version" ) );
+ }
+
+ private static boolean isJDK9Plus()
+ {
+ return javaVersion() >= JAVA9_VERSION;
+ }
+
+ private static File javaHome()
+ {
+ String javaHome = System.getProperty( "java.home" );
+ if ( !isJDK9Plus() )
+ {
+ File jre = new File( javaHome );
+ if ( "jre".equals( jre.getName() ) )
+ {
+ javaHome = jre.getParent();
+ }
+ }
+
+ try
+ {
+ File javaHomeAsDir = new File( javaHome ).getCanonicalFile();
+ if ( !javaHomeAsDir.isDirectory() )
+ {
+ throw new RuntimeException( javaHomeAsDir.getAbsolutePath() + " is \
not a JAVA_HOME directory." ); + }
+ System.out.println( "Using JAVA_HOME=" + javaHomeAsDir.getAbsolutePath() \
+ " in forked launcher." ); + return javaHomeAsDir;
+ }
+ catch ( IOException e )
+ {
+ throw new RuntimeException( e );
+ }
+ }
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java \
b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java
index 0342172..cbe02fd 100755
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java
@@ -22,12 +22,9 @@ package org.apache.maven.surefire.its.fixture;
import org.apache.maven.it.VerificationException;
import java.io.File;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
-import static org.apache.commons.lang3.StringUtils.isBlank;
-
/**
* Encapsulate all needed features to start a surefire run
* <br>
@@ -38,19 +35,17 @@ import static org.apache.commons.lang3.StringUtils.isBlank;
*/
public final class SurefireLauncher
{
- public static final String EXT_JDK_HOME_KEY = "jdk.home";
-
- public static final String EXT_JDK_HOME = System.getProperty( EXT_JDK_HOME_KEY \
);
-
- private static final File JAVA_HOME = javaHome();
-
private final MavenLauncher mavenLauncher;
private final String surefireVersion = System.getProperty( "surefire.version" );
- public SurefireLauncher( MavenLauncher mavenLauncher )
+ private final File javaHome;
+
+ public SurefireLauncher( MavenLauncher mavenLauncher, File javaHome )
{
this.mavenLauncher = mavenLauncher;
+ this.javaHome = javaHome;
+ mavenLauncher.addEnvVar( "JAVA_HOME", javaHome.getAbsolutePath() );
reset();
}
@@ -71,52 +66,11 @@ public final class SurefireLauncher
{
mavenLauncher.addGoal( s );
}
- setInProcessJavaHome();
- }
-
- private static File javaHome()
- {
- String javaHome = isBlank( EXT_JDK_HOME ) ? System.getenv( "JAVA_HOME" ) : \
EXT_JDK_HOME;
- if ( isBlank( javaHome ) )
- {
- javaHome = System.getProperty( "java.home" );
- File jre = new File( javaHome );
- if ( "jre".equals( jre.getName() ) )
- {
- javaHome = jre.getParent();
- }
- }
-
- try
- {
- File javaHomeAsDir = new File( javaHome ).getCanonicalFile();
- if ( !javaHomeAsDir.isDirectory() )
- {
- throw new RuntimeException( javaHomeAsDir.getAbsolutePath() + " is \
not a JAVA_HOME directory." );
- }
- System.out.println( "Using JAVA_HOME=" + javaHomeAsDir.getAbsolutePath() \
+ " in forked launcher." );
- return javaHomeAsDir;
- }
- catch ( IOException e )
- {
- throw new RuntimeException( e );
- }
- }
-
- private void setInProcessJavaHome()
- {
- setLauncherJavaHome( JAVA_HOME.getPath() );
- }
-
- public SurefireLauncher setLauncherJavaHome( String javaHome )
- {
- mavenLauncher.addEnvVar( "JAVA_HOME", javaHome );
- return this;
}
public SurefireLauncher getSubProjectLauncher( String subProject )
{
- return new SurefireLauncher( mavenLauncher.getSubProjectLauncher( subProject \
) ); + return new SurefireLauncher( mavenLauncher.getSubProjectLauncher( \
subProject ), javaHome ); }
public OutputValidator getSubProjectValidator( String subProject )
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncherTest.java \
b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncherTest.java
index 801ebec..5b80c2c 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncherTest.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncherTest.java
@@ -21,6 +21,7 @@ package org.apache.maven.surefire.its.fixture;
import org.junit.Test;
+import static org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase.JAVA_HOME;
import static org.junit.Assert.assertEquals;
/**
@@ -32,7 +33,7 @@ public class SurefireLauncherTest
public void launcherGetsProperMethodName()
{
MavenLauncher mavenLauncher = new MavenLauncher( SurefireLauncherTest.class, \
"foo", "" );
- String method = new SurefireLauncher( mavenLauncher ).getTestMethodName();
+ String method = new SurefireLauncher( mavenLauncher, JAVA_HOME \
).getTestMethodName(); assertEquals( "launcherGetsProperMethodName", method );
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1158RemoveInfoLinesIT.java \
b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1158RemoveInfoLinesIT.java
index 8fe2d5c..4448d67 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1158RemoveInfoLinesIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1158RemoveInfoLinesIT.java
@@ -21,13 +21,13 @@ package org.apache.maven.surefire.its.jiras;
import com.googlecode.junittoolbox.ParallelParameterized;
import org.apache.maven.surefire.its.fixture.OutputValidator;
+import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.apache.maven.surefire.its.fixture.SurefireVerifierException;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.util.ArrayList;
-import static org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase.unpack;
import static org.junit.Assert.fail;
import static org.junit.runners.Parameterized.Parameter;
import static org.junit.runners.Parameterized.Parameters;
@@ -38,7 +38,7 @@ import static org.junit.runners.Parameterized.Parameters;
* @since 2.19
*/
@RunWith( ParallelParameterized.class )
-public class Surefire1158RemoveInfoLinesIT
+public class Surefire1158RemoveInfoLinesIT extends SurefireJUnit4IntegrationTestCase
{
@Parameters( name = "{0}" )
@@ -95,9 +95,13 @@ public class Surefire1158RemoveInfoLinesIT
private OutputValidator assertTest() throws Exception
{
final String[] cli = {"--batch-mode"};
- return unpack( getClass(), "/surefire-1158-remove-info-lines", "_" + \
description, cli ).sysProp( "provider",
- provider ).addGoal( cliOption ).setTestToRun(
- testToRun \
).executeTest().verifyErrorFreeLog().assertTestSuiteResults( 1, 0, 0, 0 ); + \
return unpack( "/surefire-1158-remove-info-lines", "_" + description, cli ) + \
.sysProp( "provider", provider ) + .addGoal( cliOption )
+ .setTestToRun( testToRun )
+ .executeTest()
+ .verifyErrorFreeLog()
+ .assertTestSuiteResults( 1, 0, 0, 0 );
}
private void assertJUnitTestLogs( OutputValidator validator )
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1265Java9IT.java \
b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1265Java9IT.java
index c5d8071..9a1a446 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1265Java9IT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1265Java9IT.java
@@ -19,7 +19,7 @@ package org.apache.maven.surefire.its.jiras;
* under the License.
*/
-import org.apache.maven.surefire.its.AbstractJigsawIT;
+import org.apache.maven.surefire.its.fixture.AbstractJava9PlusIT;
import org.junit.Test;
import java.io.IOException;
@@ -39,7 +39,7 @@ import java.io.IOException;
* @since 2.20.1
*/
public class Surefire1265Java9IT
- extends AbstractJigsawIT
+ extends AbstractJava9PlusIT
{
@Test
public void shouldRunInPluginJava9() throws IOException
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1534ReuseForksFalseWithJavaModuleIT.java \
b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1534ReuseForksFalseWithJavaModuleIT.java
index 23df035..523f22f 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1534ReuseForksFalseWithJavaModuleIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1534ReuseForksFalseWithJavaModuleIT.java
@@ -19,7 +19,7 @@ package org.apache.maven.surefire.its.jiras;
* under the License.
*/
-import org.apache.maven.surefire.its.AbstractJigsawIT;
+import org.apache.maven.surefire.its.fixture.AbstractJava9PlusIT;
import org.apache.maven.surefire.its.fixture.OutputValidator;
import org.apache.maven.surefire.its.fixture.TestFile;
import org.junit.Test;
@@ -33,7 +33,7 @@ import static org.junit.Assert.assertTrue;
*
*/
public class Surefire1534ReuseForksFalseWithJavaModuleIT
- extends AbstractJigsawIT
+ extends AbstractJava9PlusIT
{
@Test
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1570ModularFailsafeIT.java \
b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1570ModularFailsafeIT.java
index bb575b0..13a9305 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1570ModularFailsafeIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1570ModularFailsafeIT.java
@@ -19,11 +19,9 @@ package org.apache.maven.surefire.its.jiras;
* under the License.
*/
-import org.apache.maven.surefire.its.AbstractJigsawIT;
-import org.junit.Before;
+import org.apache.maven.surefire.its.fixture.AbstractJava9PlusIT;
import org.junit.Test;
-import static org.apache.maven.surefire.its.fixture.HelperAssertions.assumeJavaVersionExcluded;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.is;
@@ -33,14 +31,8 @@ import static org.hamcrest.Matchers.is;
*/
@SuppressWarnings( "checkstyle:magicnumber" )
public class Surefire1570ModularFailsafeIT
- extends AbstractJigsawIT
+ extends AbstractJava9PlusIT
{
- @Before
- public void setUp()
- {
- assumeJavaVersionExcluded( 11d );
- }
-
@Test
public void shouldRunWithJupiterApi() throws Exception
{
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1712ExtractedModulenameWithoutASMIT.java \
b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1712ExtractedModulenameWithoutASMIT.java
index ce8ce68..69caf52 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1712ExtractedModulenameWithoutASMIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1712ExtractedModulenameWithoutASMIT.java
@@ -19,7 +19,7 @@ package org.apache.maven.surefire.its.jiras;
* under the License.
*/
-import org.apache.maven.surefire.its.AbstractJigsawIT;
+import org.apache.maven.surefire.its.fixture.AbstractJava9PlusIT;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.containsString;
@@ -32,7 +32,7 @@ import static org.hamcrest.CoreMatchers.is;
* @since 3.0.0-M4
*/
public class Surefire1712ExtractedModulenameWithoutASMIT
- extends AbstractJigsawIT
+ extends AbstractJava9PlusIT
{
@Test
public void test()
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1733JUnitIT.java \
b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1733JUnitIT.java
index fe45d68..c0235eb 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1733JUnitIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1733JUnitIT.java
@@ -19,7 +19,7 @@ package org.apache.maven.surefire.its.jiras;
* under the License.
*/
-import org.apache.maven.surefire.its.AbstractJigsawIT;
+import org.apache.maven.surefire.its.fixture.AbstractJava9PlusIT;
import org.junit.Test;
import static org.hamcrest.Matchers.containsString;
@@ -28,7 +28,7 @@ import static org.hamcrest.Matchers.is;
/**
* Integration test for <a \
href="https://issues.apache.org/jira/browse/SUREFIRE-1733">SUREFIRE-1733</a>.
*/
-public class Surefire1733JUnitIT extends AbstractJigsawIT
+public class Surefire1733JUnitIT extends AbstractJava9PlusIT
{
@Test
public void test() throws Exception
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1733TestngIT.java \
b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1733TestngIT.java
index 53210c7..7fbf03a 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1733TestngIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1733TestngIT.java
@@ -19,7 +19,7 @@ package org.apache.maven.surefire.its.jiras;
* under the License.
*/
-import org.apache.maven.surefire.its.AbstractJigsawIT;
+import org.apache.maven.surefire.its.fixture.AbstractJava9PlusIT;
import org.junit.Test;
import static org.hamcrest.Matchers.containsString;
@@ -28,7 +28,7 @@ import static org.hamcrest.Matchers.is;
/**
* Integration test for <a \
href="https://issues.apache.org/jira/browse/SUREFIRE-1733">SUREFIRE-1733</a>.
*/
-public class Surefire1733TestngIT extends AbstractJigsawIT
+public class Surefire1733TestngIT extends AbstractJava9PlusIT
{
@Test
public void test() throws Exception
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire673MockitoIT.java \
b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire673MockitoIT.java
index 74469c9..1b5d03f 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire673MockitoIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire673MockitoIT.java
@@ -20,16 +20,26 @@ package org.apache.maven.surefire.its.jiras;
*/
import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
+import org.junit.Before;
import org.junit.Test;
+import static org.apache.maven.surefire.its.fixture.HelperAssertions.assumeJavaVersion;
+
/**
* SUREFIRE-673 Asserts that a given mockito build works as it should (classloader \
problem in 2.7)
*
* @author Kristian Rosenvold
*/
+@SuppressWarnings( "checkstyle:magicnumber" )
public class Surefire673MockitoIT
extends SurefireJUnit4IntegrationTestCase
{
+ @Before
+ public void assumeJava8Plus()
+ {
+ assumeJavaVersion( 1.8d );
+ }
+
@Test
public void testBuildFailingWhenErrors()
{
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire946KillMainProcessInReusableForkIT.java \
b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire946KillMainProcessInReusableForkIT.java
index 4be28e7..84d32da 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire946KillMainProcessInReusableForkIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire946KillMainProcessInReusableForkIT.java
@@ -90,8 +90,7 @@ public class Surefire946KillMainProcessInReusableForkIT
synchronized ( LOCK_DEPENDENCY )
{
classifierOfDummyDependency = shutdownMavenMethod + \
shutdownSurefireMethod;
- unpack( Surefire946KillMainProcessInReusableForkIT.class,
- "surefire-946-dummy-dependency", classifierOfDummyDependency )
+ unpack( "surefire-946-dummy-dependency", classifierOfDummyDependency )
.sysProp( "distinct.classifier", classifierOfDummyDependency )
.executeInstall();
}
diff --git a/surefire-its/src/test/resources/java9-full-api/pom.xml \
b/surefire-its/src/test/resources/java9-full-api/pom.xml index c8aa635..d1dfe79 \
100644
--- a/surefire-its/src/test/resources/java9-full-api/pom.xml
+++ b/surefire-its/src/test/resources/java9-full-api/pom.xml
@@ -96,7 +96,7 @@
<id>use-jvm-config-paramater</id>
<activation>
<property>
- <name>jdk.home</name>
+ <name>jdkHome</name>
</property>
</activation>
<build>
@@ -104,7 +104,7 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <jvm>${jdk.home}/bin/java</jvm>
+ <jvm>${jdkHome}/bin/java</jvm>
</configuration>
</plugin>
</plugins>
diff --git a/surefire-its/src/test/resources/junit-pathWithUmlaut/pom.xml \
b/surefire-its/src/test/resources/junit-pathWithUmlaut/pom.xml index 6c79c08..f20ebee \
100644
--- a/surefire-its/src/test/resources/junit-pathWithUmlaut/pom.xml
+++ b/surefire-its/src/test/resources/junit-pathWithUmlaut/pom.xml
@@ -58,6 +58,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
+ <encoding>UTF-8</encoding>
<skip>${skipCompiler}</skip>
<skipMain>${skipCompiler}</skipMain>
</configuration>
diff --git a/surefire-its/src/test/resources/junit47-cucumber/pom.xml \
b/surefire-its/src/test/resources/junit47-cucumber/pom.xml index a57d3c4..a6d0ea4 \
100644
--- a/surefire-its/src/test/resources/junit47-cucumber/pom.xml
+++ b/surefire-its/src/test/resources/junit47-cucumber/pom.xml
@@ -34,8 +34,7 @@
<name>Tests cucumber with JUnit47 provider</name>
<properties>
- <cucumber.version>1.1.3</cucumber.version>
- <junit.version>4.11</junit.version>
+ <cucumber.version>6.10.0</cucumber.version>
</properties>
<build>
@@ -60,19 +59,13 @@
<dependencies>
<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>info.cukes</groupId>
+ <groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>${cucumber.version}</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>info.cukes</groupId>
+ <groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>${cucumber.version}</version>
<scope>test</scope>
diff --git a/surefire-its/src/test/resources/junit47-cucumber/src/test/java/org/sample/cucumber/FailingCucumberTest.java \
b/surefire-its/src/test/resources/junit47-cucumber/src/test/java/org/sample/cucumber/FailingCucumberTest.java
index ed86734..448b877 100644
--- a/surefire-its/src/test/resources/junit47-cucumber/src/test/java/org/sample/cucumber/FailingCucumberTest.java
+++ b/surefire-its/src/test/resources/junit47-cucumber/src/test/java/org/sample/cucumber/FailingCucumberTest.java
@@ -21,10 +21,11 @@ package org.sample.cucumber;
import org.junit.runner.RunWith;
-import cucumber.api.junit.Cucumber;
+import io.cucumber.junit.CucumberOptions;
+import io.cucumber.junit.Cucumber;
@RunWith( Cucumber.class )
-@Cucumber.Options( features = { "classpath:failing" } )
+@CucumberOptions( features = { "classpath:failing" } )
public class FailingCucumberTest
{
diff --git a/surefire-its/src/test/resources/junit47-cucumber/src/test/java/org/sample/cucumber/StepDefs.java \
b/surefire-its/src/test/resources/junit47-cucumber/src/test/java/org/sample/cucumber/StepDefs.java
index ba25f69..e5e7339 100644
--- a/surefire-its/src/test/resources/junit47-cucumber/src/test/java/org/sample/cucumber/StepDefs.java
+++ b/surefire-its/src/test/resources/junit47-cucumber/src/test/java/org/sample/cucumber/StepDefs.java
@@ -19,9 +19,9 @@
package org.sample.cucumber;
-import cucumber.api.java.en.Given;
-import cucumber.api.java.en.Then;
-import cucumber.api.java.en.When;
+import io.cucumber.java.en.Given;
+import io.cucumber.java.en.Then;
+import io.cucumber.java.en.When;
import static org.junit.Assert.fail;
diff --git a/surefire-its/src/test/resources/junit47-cucumber/src/test/java/org/sample/cucumber/SuccessCucumberTest.java \
b/surefire-its/src/test/resources/junit47-cucumber/src/test/java/org/sample/cucumber/SuccessCucumberTest.java
index 318f5e6..7ba238b 100644
--- a/surefire-its/src/test/resources/junit47-cucumber/src/test/java/org/sample/cucumber/SuccessCucumberTest.java
+++ b/surefire-its/src/test/resources/junit47-cucumber/src/test/java/org/sample/cucumber/SuccessCucumberTest.java
@@ -21,10 +21,11 @@ package org.sample.cucumber;
import org.junit.runner.RunWith;
-import cucumber.api.junit.Cucumber;
+import io.cucumber.junit.CucumberOptions;
+import io.cucumber.junit.Cucumber;
@RunWith( Cucumber.class )
-@Cucumber.Options( features = { "classpath:success" } )
+@CucumberOptions( features = { "classpath:success" } )
public class SuccessCucumberTest
{
diff --git a/surefire-its/src/test/resources/junit47-rerun-failing-tests-with-cucumber/pom.xml \
b/surefire-its/src/test/resources/junit47-rerun-failing-tests-with-cucumber/pom.xml \
index d58223c..5c5f836 100644
--- a/surefire-its/src/test/resources/junit47-rerun-failing-tests-with-cucumber/pom.xml
+++ b/surefire-its/src/test/resources/junit47-rerun-failing-tests-with-cucumber/pom.xml
@@ -33,7 +33,7 @@
<name>Test for rerun failing cucumber tests in JUnit 47</name>
<properties>
- <cucumber.version>2.0.0</cucumber.version>
+ <cucumber.version>6.10.0</cucumber.version>
</properties>
<build>
@@ -58,12 +58,6 @@
<dependencies>
<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>${cucumber.version}</version>
diff --git a/surefire-its/src/test/resources/junit47-rerun-failing-tests-with-cucumber/src/test/java/org/sample/cucumber/FlakeCucumberTest.java \
b/surefire-its/src/test/resources/junit47-rerun-failing-tests-with-cucumber/src/test/java/org/sample/cucumber/FlakeCucumberTest.java
index ecda87b..841ea52 100644
--- a/surefire-its/src/test/resources/junit47-rerun-failing-tests-with-cucumber/src/test/java/org/sample/cucumber/FlakeCucumberTest.java
+++ b/surefire-its/src/test/resources/junit47-rerun-failing-tests-with-cucumber/src/test/java/org/sample/cucumber/FlakeCucumberTest.java
@@ -19,9 +19,10 @@
package org.sample.cucumber;
-import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;
+import io.cucumber.junit.Cucumber;
+
@RunWith( Cucumber.class )
public class FlakeCucumberTest
{
diff --git a/surefire-its/src/test/resources/junit47-rerun-failing-tests-with-cucumber/src/test/java/org/sample/cucumber/StepDefs.java \
b/surefire-its/src/test/resources/junit47-rerun-failing-tests-with-cucumber/src/test/java/org/sample/cucumber/StepDefs.java
index d253222..7e4e2da 100644
--- a/surefire-its/src/test/resources/junit47-rerun-failing-tests-with-cucumber/src/test/java/org/sample/cucumber/StepDefs.java
+++ b/surefire-its/src/test/resources/junit47-rerun-failing-tests-with-cucumber/src/test/java/org/sample/cucumber/StepDefs.java
@@ -19,9 +19,9 @@
package org.sample.cucumber;
-import cucumber.api.java.en.Given;
-import cucumber.api.java.en.Then;
-import cucumber.api.java.en.When;
+import io.cucumber.java.en.Given;
+import io.cucumber.java.en.Then;
+import io.cucumber.java.en.When;
import static org.junit.Assert.fail;
diff --git a/surefire-its/src/test/resources/surefire-673-mockito/pom.xml \
b/surefire-its/src/test/resources/surefire-673-mockito/pom.xml index 0b03c13..8e8881d \
100644
--- a/surefire-its/src/test/resources/surefire-673-mockito/pom.xml
+++ b/surefire-its/src/test/resources/surefire-673-mockito/pom.xml
@@ -30,7 +30,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
- <version>1.8.5</version>
+ <version>3.8.0</version>
<scope>test</scope>
</dependency>
</dependencies>
diff --git a/surefire-its/src/test/resources/surefire-855-failsafe-use-war/pom.xml \
b/surefire-its/src/test/resources/surefire-855-failsafe-use-war/pom.xml index \
5939884..06a91f0 100644
--- a/surefire-its/src/test/resources/surefire-855-failsafe-use-war/pom.xml
+++ b/surefire-its/src/test/resources/surefire-855-failsafe-use-war/pom.xml
@@ -103,7 +103,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
- <version>2.4</version>
+ <version>3.3.1</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
diff --git a/surefire-its/src/test/resources/toolchains.xml \
b/surefire-its/src/test/resources/toolchains.xml index f9f1d66..235c23a 100644
--- a/surefire-its/src/test/resources/toolchains.xml
+++ b/surefire-its/src/test/resources/toolchains.xml
@@ -29,7 +29,7 @@
<vendor>oracle</vendor>
</provides>
<configuration>
- <jdkHome>${jdk.home}</jdkHome>
+ <jdkHome>${jdkHome}</jdkHome>
</configuration>
</toolchain>
</toolchains>
diff --git a/surefire-providers/surefire-junit-platform/pom.xml \
b/surefire-providers/surefire-junit-platform/pom.xml index 1cc04f5..54430da 100644
--- a/surefire-providers/surefire-junit-platform/pom.xml
+++ b/surefire-providers/surefire-junit-platform/pom.xml
@@ -164,7 +164,6 @@
<version>3.0.0-M4</version> <!-- ${shadedVersion}, but resolved due \
to https://issues.apache.org/jira/browse/MRELEASE-799 --> <configuration>
<argLine>${jvm.args.tests} ${jacoco.agent}</argLine>
- <jvm>${java.home}/bin/java</jvm>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<includes>
<include>**/JUnit47SuiteTest.java</include>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic