[SUREFIRE-1486] maven-failsafe-plugin does not use JUnit adapter for JUnit4 annotations and TestNG providers do not have maven-surefire-plugin config in POM
Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/63e0aa41 Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/63e0aa41 Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/63e0aa41 Branch: refs/heads/master Commit: 63e0aa41dbd8483b36d50c2e68b237e75d0a2d78 Parents: 8fdcd20 Author: Tibor17 <tibordig...@apache.org> Authored: Fri Mar 2 23:01:16 2018 +0100 Committer: Tibor17 <tibordig...@apache.org> Committed: Fri Mar 2 23:01:16 2018 +0100 ---------------------------------------------------------------------- maven-failsafe-plugin/pom.xml | 5 +++ .../maven/plugin/failsafe/JUnit4SuiteTest.java | 46 ++++++++++++++++++++ .../surefire/junitcore/JUnit47SuiteTest.java | 1 - .../surefire-testng-utils/pom.xml | 10 +++++ surefire-providers/surefire-testng/pom.xml | 12 +++++ 5 files changed, 73 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/63e0aa41/maven-failsafe-plugin/pom.xml ---------------------------------------------------------------------- diff --git a/maven-failsafe-plugin/pom.xml b/maven-failsafe-plugin/pom.xml index 199f34c..ea2c07f 100644 --- a/maven-failsafe-plugin/pom.xml +++ b/maven-failsafe-plugin/pom.xml @@ -110,6 +110,11 @@ <version>2.12.4</version> <!-- ${shadedVersion}, but resolved due to https://issues.apache.org/jira/browse/MRELEASE-799 --> </dependency> </dependencies> + <configuration> + <includes> + <include>**/JUnit4SuiteTest.java</include> + </includes> + </configuration> </plugin> <plugin> <artifactId>maven-dependency-plugin</artifactId> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/63e0aa41/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/JUnit4SuiteTest.java ---------------------------------------------------------------------- diff --git a/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/JUnit4SuiteTest.java b/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/JUnit4SuiteTest.java new file mode 100644 index 0000000..decaf86 --- /dev/null +++ b/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/JUnit4SuiteTest.java @@ -0,0 +1,46 @@ +package org.apache.maven.plugin.failsafe; + +/* + * 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 junit.framework.JUnit4TestAdapter; +import junit.framework.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; +import org.junit.runners.Suite.SuiteClasses; + +/** + * Adapt the JUnit4 tests which use only annotations to the JUnit3 test suite. + * + * @author Tibor Digana (tibor17) + * @since 2.21.0 + */ +@SuiteClasses( { + IntegrationTestMojoTest.class, + MarshallerUnmarshallerTest.class, + RunResultTest.class +} ) +@RunWith( Suite.class ) +public class JUnit4SuiteTest +{ + public static Test suite() + { + return new JUnit4TestAdapter( JUnit4SuiteTest.class ); + } +} http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/63e0aa41/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnit47SuiteTest.java ---------------------------------------------------------------------- diff --git a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnit47SuiteTest.java b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnit47SuiteTest.java index 5392cc8..9954627 100644 --- a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnit47SuiteTest.java +++ b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnit47SuiteTest.java @@ -40,7 +40,6 @@ import org.junit.runners.Suite; ParallelComputerUtilTest.class, ParallelComputerBuilderTest.class, SchedulingStrategiesTest.class, - JUnitCoreParametersTest.class, OptimizedParallelComputerTest.class, ConcurrentRunListenerTest.class, ConfigurableParallelComputerTest.class, http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/63e0aa41/surefire-providers/surefire-testng-utils/pom.xml ---------------------------------------------------------------------- diff --git a/surefire-providers/surefire-testng-utils/pom.xml b/surefire-providers/surefire-testng-utils/pom.xml index 66df28e..0f0a6cd 100644 --- a/surefire-providers/surefire-testng-utils/pom.xml +++ b/surefire-providers/surefire-testng-utils/pom.xml @@ -83,6 +83,16 @@ </execution> </executions> </plugin> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <dependencies> + <dependency> + <groupId>org.apache.maven.surefire</groupId> + <artifactId>surefire-shadefire</artifactId> + <version>2.12.4</version> <!-- ${shadedVersion}, but resolved due to https://issues.apache.org/jira/browse/MRELEASE-799 --> + </dependency> + </dependencies> + </plugin> </plugins> </build> </project> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/63e0aa41/surefire-providers/surefire-testng/pom.xml ---------------------------------------------------------------------- diff --git a/surefire-providers/surefire-testng/pom.xml b/surefire-providers/surefire-testng/pom.xml index 22fcc15..d21aa89 100644 --- a/surefire-providers/surefire-testng/pom.xml +++ b/surefire-providers/surefire-testng/pom.xml @@ -64,5 +64,17 @@ <targetPath>META-INF</targetPath> </resource> </resources> + <plugins> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <dependencies> + <dependency> + <groupId>org.apache.maven.surefire</groupId> + <artifactId>surefire-shadefire</artifactId> + <version>2.12.4</version> <!-- ${shadedVersion}, but resolved due to https://issues.apache.org/jira/browse/MRELEASE-799 --> + </dependency> + </dependencies> + </plugin> + </plugins> </build> </project>