You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ti...@apache.org on 2019/07/14 23:59:08 UTC

[maven-surefire] 01/03: [SUREFIRE-1678] JUnit5 Integration Tests should test wide spectrum of versions

This is an automated email from the ASF dual-hosted git repository.

tibordigana pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git

commit f46044ea1d20618a01ea9c9b0d04e1efa8af960a
Author: tibordigana <ti...@apache.org>
AuthorDate: Fri Jul 12 18:40:29 2019 +0200

    [SUREFIRE-1678] JUnit5 Integration Tests should test wide spectrum of versions
---
 pom.xml                                            |  5 +++
 surefire-its/pom.xml                               |  8 ++++
 .../maven/surefire/its/JUnitPlatformEnginesIT.java |  5 ++-
 .../apache/maven/surefire/its/JUnitPlatformIT.java | 51 +++++++++++++++++++---
 .../resources/junit-platform-engine-jqwik/pom.xml  |  2 +-
 .../junit-platform-engine-jupiter/pom.xml          | 18 ++++++--
 .../junit-platform-engine-vintage/pom.xml          | 15 ++++++-
 .../junit-platform-multiple-engines/pom.xml        | 39 +++++++++++++++--
 .../src/test/resources/junit-platform-tags/pom.xml | 15 ++++++-
 9 files changed, 139 insertions(+), 19 deletions(-)

diff --git a/pom.xml b/pom.xml
index 78ebe81..d27edf6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -403,6 +403,11 @@
         <classifier>runtime</classifier>
         <version>${jacocoVersion}</version>
       </dependency>
+      <dependency>
+        <groupId>com.googlecode.junit-toolbox</groupId>
+        <artifactId>junit-toolbox</artifactId>
+        <version>1.11</version>
+      </dependency>
     </dependencies>
   </dependencyManagement>
   <dependencies>
diff --git a/surefire-its/pom.xml b/surefire-its/pom.xml
index c6523cd..2c4a7e6 100644
--- a/surefire-its/pom.xml
+++ b/surefire-its/pom.xml
@@ -78,6 +78,11 @@
             <artifactId>commons-lang3</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>com.googlecode.junit-toolbox</groupId>
+            <artifactId>junit-toolbox</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
     <build>
@@ -183,6 +188,9 @@
                         <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 -->
+                        <maxParallelTestThreads>3</maxParallelTestThreads>
                     </systemPropertyVariables>
                     <redirectTestOutputToFile>true</redirectTestOutputToFile>
                 </configuration>
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformEnginesIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformEnginesIT.java
index 6ef402b..15bcbfb 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformEnginesIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformEnginesIT.java
@@ -57,7 +57,7 @@ public class JUnitPlatformEnginesIT
     public String apiguardian;
 
     @Parameters(name = "{0}")
-    public static Iterable<Object[]> regexVersions()
+    public static Iterable<Object[]> artifactVersions()
     {
         ArrayList<Object[]> args = new ArrayList<>();
         args.add( new Object[] { "1.0.3", "5.0.3", "1.0.0", "1.0.0" } );
@@ -66,7 +66,8 @@ public class JUnitPlatformEnginesIT
         args.add( new Object[] { "1.3.2", "5.3.2", "1.1.1", "1.0.0" } );
         args.add( new Object[] { "1.4.2", "5.4.2", "1.1.1", "1.0.0" } );
         args.add( new Object[] { "1.5.0-RC1", "5.5.0-RC1", "1.2.0", "1.1.0" } );
-        args.add( new Object[] { "1.5.0-SNAPSHOT", "5.5.0-SNAPSHOT", "1.2.0", "1.1.0" } );
+        args.add( new Object[] { "1.5.0", "5.5.0", "1.2.0", "1.1.0" } );
+        args.add( new Object[] { "1.6.0-SNAPSHOT", "5.6.0-SNAPSHOT", "1.2.0", "1.1.0" } );
         return args;
     }
 
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformIT.java
index 9522ebe..2cf431a 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformIT.java
@@ -19,15 +19,21 @@ package org.apache.maven.surefire.its;
  * under the License.
  */
 
+import com.googlecode.junittoolbox.ParallelParameterized;
 import org.apache.maven.surefire.its.fixture.OutputValidator;
 import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized.Parameter;
+import org.junit.runners.Parameterized.Parameters;
+
+import java.util.ArrayList;
 
 import static java.nio.charset.StandardCharsets.UTF_8;
 import static org.apache.maven.surefire.its.fixture.HelperAssertions.assumeJavaVersion;
-import static org.apache.maven.surefire.its.fixture.HelperAssertions.convertUnicodeToUTF8;
 
+@RunWith( ParallelParameterized.class )
 public class JUnitPlatformIT
         extends SurefireJUnit4IntegrationTestCase
 {
@@ -36,6 +42,26 @@ public class JUnitPlatformIT
                     + "\"https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report-3.0.xsd\" "
                     + "version=\"3.0\" name=\"&lt;&lt; ✨ &gt;&gt;\"";
 
+    @Parameter
+    public String junit5Version;
+
+    @Parameter( 1 )
+    public String jqwikVersion;
+
+    @Parameters( name = "{0}" )
+    public static Iterable<Object[]> artifactVersions()
+    {
+        ArrayList<Object[]> args = new ArrayList<>();
+        args.add( new Object[] { "5.2.0", "0.8.0" } );
+        args.add( new Object[] { "5.3.0", "0.8.15" } );
+        args.add( new Object[] { "5.3.2", "0.9.0" } );
+        args.add( new Object[] { "5.4.0", "0.9.3" } );
+        args.add( new Object[] { "5.4.2", "1.0.0" } );
+        args.add( new Object[] { "5.5.0", "1.1.0" } );
+        args.add( new Object[] { "5.6.0-SNAPSHOT", "1.1.6" } );
+        return args;
+    }
+
     @Before
     public void setUp()
     {
@@ -45,8 +71,10 @@ public class JUnitPlatformIT
     @Test
     public void testJupiterEngine()
     {
-        unpack( "/junit-platform-engine-jupiter" )
+        unpack( "junit-platform-engine-jupiter", "-" + junit5Version + "-" + jqwikVersion )
                 .setTestToRun( "Basic*Test" )
+                .sysProp( "junit5.version", junit5Version )
+                .sysProp( "jqwik.version", jqwikVersion )
                 .executeTest()
                 .verifyErrorFree( 5 );
     }
@@ -54,7 +82,9 @@ public class JUnitPlatformIT
     @Test
     public void testJupiterEngineWithDisplayNames()
     {
-        OutputValidator validator = unpack( "/junit-platform-engine-jupiter" )
+        OutputValidator validator = unpack( "junit-platform-engine-jupiter", "-" + junit5Version + "-" + jqwikVersion )
+                .sysProp( "junit5.version", junit5Version )
+                .sysProp( "jqwik.version", jqwikVersion )
                 .executeTest()
                 .verifyErrorFree( 7 );
 
@@ -87,7 +117,9 @@ public class JUnitPlatformIT
     @Test
     public void testVintageEngine()
     {
-        unpack( "/junit-platform-engine-vintage" )
+        unpack( "junit-platform-engine-vintage", "-" + junit5Version + "-" + jqwikVersion )
+                .sysProp( "junit5.version", junit5Version )
+                .sysProp( "jqwik.version", jqwikVersion )
                 .executeTest()
                 .verifyErrorFree( 1 );
     }
@@ -95,7 +127,9 @@ public class JUnitPlatformIT
     @Test
     public void testJQwikEngine()
     {
-        unpack( "/junit-platform-engine-jqwik" )
+        unpack( "junit-platform-engine-jqwik", "-" + junit5Version + "-" + jqwikVersion )
+                .sysProp( "junit5.version", junit5Version )
+                .sysProp( "jqwik.version", jqwikVersion )
                 .executeTest()
                 .verifyErrorFree( 1 );
     }
@@ -103,7 +137,9 @@ public class JUnitPlatformIT
     @Test
     public void testMultipleEngines()
     {
-        unpack( "/junit-platform-multiple-engines" )
+        unpack( "junit-platform-multiple-engines", "-" + junit5Version + "-" + jqwikVersion )
+                .sysProp( "junit5.version", junit5Version )
+                .sysProp( "jqwik.version", jqwikVersion )
                 .executeTest()
                 .verifyErrorFree( 7 );
     }
@@ -111,7 +147,8 @@ public class JUnitPlatformIT
     @Test
     public void testTags()
     {
-        unpack( "/junit-platform-tags" )
+        unpack( "junit-platform-tags", "-" + junit5Version + "-" + jqwikVersion )
+                .sysProp( "junit5.version", junit5Version )
                 .executeTest()
                 .verifyErrorFree( 2 );
     }
diff --git a/surefire-its/src/test/resources/junit-platform-engine-jqwik/pom.xml b/surefire-its/src/test/resources/junit-platform-engine-jqwik/pom.xml
index 8e27d56..4631dea 100644
--- a/surefire-its/src/test/resources/junit-platform-engine-jqwik/pom.xml
+++ b/surefire-its/src/test/resources/junit-platform-engine-jqwik/pom.xml
@@ -42,7 +42,7 @@
         <dependency>
             <groupId>net.jqwik</groupId>
             <artifactId>jqwik</artifactId>
-            <version>0.8.10</version>
+            <version>${jqwik.version}</version>
             <scope>test</scope>
         </dependency>
     </dependencies>
diff --git a/surefire-its/src/test/resources/junit-platform-engine-jupiter/pom.xml b/surefire-its/src/test/resources/junit-platform-engine-jupiter/pom.xml
index 4947646..a7128ae 100644
--- a/surefire-its/src/test/resources/junit-platform-engine-jupiter/pom.xml
+++ b/surefire-its/src/test/resources/junit-platform-engine-jupiter/pom.xml
@@ -31,7 +31,6 @@
     <properties>
         <maven.compiler.source>1.8</maven.compiler.source>
         <maven.compiler.target>1.8</maven.compiler.target>
-        <junit.jupiter.version>5.2.0</junit.jupiter.version>
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
     </properties>
 
@@ -45,13 +44,13 @@
         <dependency>
             <groupId>org.junit.jupiter</groupId>
             <artifactId>junit-jupiter-engine</artifactId>
-            <version>${junit.jupiter.version}</version>
+            <version>${junit5.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.junit.jupiter</groupId>
             <artifactId>junit-jupiter-params</artifactId>
-            <version>${junit.jupiter.version}</version>
+            <version>${junit5.version}</version>
             <scope>test</scope>
         </dependency>
     </dependencies>
@@ -95,4 +94,17 @@
             </plugin>
         </plugins>
     </build>
+
+    <repositories>
+        <repository>
+            <id>oss-sonatype</id>
+            <name>oss-sonatype</name>
+            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
+            <snapshots>
+                <enabled>true</enabled>
+                <updatePolicy>always</updatePolicy>
+                <checksumPolicy>ignore</checksumPolicy>
+            </snapshots>
+        </repository>
+    </repositories>
 </project>
diff --git a/surefire-its/src/test/resources/junit-platform-engine-vintage/pom.xml b/surefire-its/src/test/resources/junit-platform-engine-vintage/pom.xml
index 38b788f..20ad7b3 100644
--- a/surefire-its/src/test/resources/junit-platform-engine-vintage/pom.xml
+++ b/surefire-its/src/test/resources/junit-platform-engine-vintage/pom.xml
@@ -43,7 +43,7 @@
         <dependency>
             <groupId>org.junit.vintage</groupId>
             <artifactId>junit-vintage-engine</artifactId>
-            <version>5.2.0</version>
+            <version>${junit5.version}</version>
             <scope>test</scope>
         </dependency>
     </dependencies>
@@ -57,4 +57,17 @@
             </plugin>
         </plugins>
     </build>
+
+    <repositories>
+        <repository>
+            <id>oss-sonatype</id>
+            <name>oss-sonatype</name>
+            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
+            <snapshots>
+                <enabled>true</enabled>
+                <updatePolicy>always</updatePolicy>
+                <checksumPolicy>ignore</checksumPolicy>
+            </snapshots>
+        </repository>
+    </repositories>
 </project>
diff --git a/surefire-its/src/test/resources/junit-platform-multiple-engines/pom.xml b/surefire-its/src/test/resources/junit-platform-multiple-engines/pom.xml
index e7f50a3..2cd1827 100644
--- a/surefire-its/src/test/resources/junit-platform-multiple-engines/pom.xml
+++ b/surefire-its/src/test/resources/junit-platform-multiple-engines/pom.xml
@@ -37,26 +37,44 @@
         <dependency>
             <groupId>org.junit.jupiter</groupId>
             <artifactId>junit-jupiter-engine</artifactId>
-            <version>5.2.0</version>
+            <version>${junit5.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.junit.jupiter</groupId>
             <artifactId>junit-jupiter-params</artifactId>
-            <version>5.2.0</version>
+            <version>${junit5.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.junit.vintage</groupId>
             <artifactId>junit-vintage-engine</artifactId>
-            <version>5.2.0</version>
+            <version>${junit5.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>net.jqwik</groupId>
             <artifactId>jqwik</artifactId>
-            <version>0.8.10</version>
+            <version>${jqwik.version}</version>
             <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.junit.platform</groupId>
+                    <artifactId>junit-platform-commons</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.junit.platform</groupId>
+                    <artifactId>junit-platform-engine</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.apiguardian</groupId>
+                    <artifactId>apiguardian-api</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.opentest4j</groupId>
+                    <artifactId>opentest4j</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
     </dependencies>
 
@@ -69,4 +87,17 @@
             </plugin>
         </plugins>
     </build>
+
+    <repositories>
+        <repository>
+            <id>oss-sonatype</id>
+            <name>oss-sonatype</name>
+            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
+            <snapshots>
+                <enabled>true</enabled>
+                <updatePolicy>always</updatePolicy>
+                <checksumPolicy>ignore</checksumPolicy>
+            </snapshots>
+        </repository>
+    </repositories>
 </project>
diff --git a/surefire-its/src/test/resources/junit-platform-tags/pom.xml b/surefire-its/src/test/resources/junit-platform-tags/pom.xml
index 0fb64cf..cef7f35 100644
--- a/surefire-its/src/test/resources/junit-platform-tags/pom.xml
+++ b/surefire-its/src/test/resources/junit-platform-tags/pom.xml
@@ -36,7 +36,7 @@
         <dependency>
             <groupId>org.junit.jupiter</groupId>
             <artifactId>junit-jupiter-engine</artifactId>
-            <version>5.2.0</version>
+            <version>${junit5.version}</version>
             <scope>test</scope>
         </dependency>
     </dependencies>
@@ -54,4 +54,17 @@
             </plugin>
         </plugins>
     </build>
+
+    <repositories>
+        <repository>
+            <id>oss-sonatype</id>
+            <name>oss-sonatype</name>
+            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
+            <snapshots>
+                <enabled>true</enabled>
+                <updatePolicy>always</updatePolicy>
+                <checksumPolicy>ignore</checksumPolicy>
+            </snapshots>
+        </repository>
+    </repositories>
 </project>