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 2017/08/03 14:37:56 UTC

[06/17] maven-surefire git commit: Add surefire-junit5 provider as module to the surefire build

Add surefire-junit5 provider as module to the surefire build


Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/e842f9b3
Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/e842f9b3
Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/e842f9b3

Branch: refs/heads/junit5
Commit: e842f9b361845176a6e883d7bf12838f94e89872
Parents: c4e77a8
Author: Benedikt Ritter <br...@apache.org>
Authored: Mon Feb 6 18:55:49 2017 +0100
Committer: Benedikt Ritter <br...@apache.org>
Committed: Mon Jun 12 08:18:34 2017 +0200

----------------------------------------------------------------------
 surefire-providers/pom.xml                      |   1 +
 surefire-providers/surefire-junit5/pom.xml      | 166 +++++++++++++++++++
 .../surefire/provider/RunListenerAdapter.java   |   4 +-
 .../provider/SurefireProviderTestSuite.java     |  49 ------
 4 files changed, 169 insertions(+), 51 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e842f9b3/surefire-providers/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-providers/pom.xml b/surefire-providers/pom.xml
index 1501554..8c69725 100644
--- a/surefire-providers/pom.xml
+++ b/surefire-providers/pom.xml
@@ -41,6 +41,7 @@
     <module>surefire-junit3</module>
     <module>surefire-junit4</module>
     <module>surefire-junit47</module>
+    <module>surefire-junit5</module>
     <module>surefire-testng-utils</module>
     <module>surefire-testng</module>
   </modules>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e842f9b3/surefire-providers/surefire-junit5/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit5/pom.xml b/surefire-providers/surefire-junit5/pom.xml
new file mode 100644
index 0000000..55099f5
--- /dev/null
+++ b/surefire-providers/surefire-junit5/pom.xml
@@ -0,0 +1,166 @@
+<!--
+  ~ 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.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.maven.surefire</groupId>
+    <artifactId>surefire-providers</artifactId>
+    <version>2.19.2-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>surefire-junit5</artifactId>
+
+  <name>SureFire JUnit5 Runner</name>
+  <description>SureFire JUnit 5.0+ Runner</description>
+
+  <properties>
+    <javaVersion>8</javaVersion>
+    <junit-platform.version>1.0.0-M3</junit-platform.version>
+    <junit-jupiter.version>5.0.0-M3</junit-jupiter.version>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.junit.platform</groupId>
+      <artifactId>junit-platform-launcher</artifactId>
+      <version>${junit-platform.version}</version>
+    </dependency>
+    <!-- FIXME: dependency is currenlty needed in scope compile because the initial implementation uses the internal
+         Preconditions class -->
+    <dependency>
+      <groupId>org.junit.platform</groupId>
+      <artifactId>junit-platform-engine</artifactId>
+      <version>${junit-platform.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.surefire</groupId>
+      <artifactId>common-java5</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+      <version>${junit-jupiter.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
+      <version>${junit-jupiter.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <version>2.2.22</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.assertj</groupId>
+      <artifactId>assertj-core</artifactId>
+      <version>3.6.0</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <resources>
+      <resource>
+        <directory>src/main/resources/META-INF</directory>
+        <targetPath>META-INF</targetPath>
+      </resource>
+    </resources>
+
+    <plugins>
+      <!-- Override default configuration for Java 1.6 -->
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>animal-sniffer-maven-plugin</artifactId>
+        <version>1.14</version>
+        <executions>
+          <execution>
+            <id>signature-check</id>
+            <goals>
+              <goal>check</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <signature>
+            <groupId>org.codehaus.mojo.signature</groupId>
+            <artifactId>java18</artifactId>
+            <version>1.0</version>
+          </signature>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <jvm>${java.home}/bin/java</jvm>
+        </configuration>
+        <dependencies>
+          <dependency>
+            <groupId>org.junit.platform</groupId>
+            <artifactId>junit-platform-surefire-provider</artifactId>
+            <version>${junit-platform.version}</version>
+          </dependency>
+          <dependency>
+            <groupId>org.junit.jupiter</groupId>
+            <artifactId>junit-jupiter-engine</artifactId>
+            <version>${junit-jupiter.version}</version>
+          </dependency>
+        </dependencies>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>1.4</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <minimizeJar>true</minimizeJar>
+              <artifactSet>
+                <includes>
+                  <include>org.apache.maven.surefire:common-junit3</include>
+                  <include>org.apache.maven.surefire:common-junit4</include>
+                  <include>org.apache.maven.surefire:common-java5</include>
+                  <include>org.apache.maven.shared:maven-shared-utils</include>
+                </includes>
+              </artifactSet>
+              <relocations>
+                <relocation>
+                  <pattern>org.apache.maven.shared</pattern>
+                  <shadedPattern>org.apache.maven.surefire.shade.org.apache.maven.shared</shadedPattern>
+                </relocation>
+              </relocations>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e842f9b3/surefire-providers/surefire-junit5/src/main/java/org/junit/platform/surefire/provider/RunListenerAdapter.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit5/src/main/java/org/junit/platform/surefire/provider/RunListenerAdapter.java b/surefire-providers/surefire-junit5/src/main/java/org/junit/platform/surefire/provider/RunListenerAdapter.java
index a7d8489..6319a14 100644
--- a/surefire-providers/surefire-junit5/src/main/java/org/junit/platform/surefire/provider/RunListenerAdapter.java
+++ b/surefire-providers/surefire-junit5/src/main/java/org/junit/platform/surefire/provider/RunListenerAdapter.java
@@ -106,11 +106,11 @@ final class RunListenerAdapter
         {
             StackTraceWriter traceWriter = new PojoStackTraceWriter( className.get(),
                 getMethodName( testIdentifier ).orElse( "" ), throwable.orElse( null ) );
-            return new SimpleReportEntry( className.get(), testIdentifier.getDisplayName(), traceWriter, null );
+            return new SimpleReportEntry( className.get(), testIdentifier.getDisplayName(), traceWriter, (Integer) null );
         }
         else
         {
-            return new SimpleReportEntry( parentDisplayName( testIdentifier ), testIdentifier.getDisplayName(), null );
+            return new SimpleReportEntry( parentDisplayName( testIdentifier ), testIdentifier.getDisplayName(), (Integer) null );
         }
     }
 

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e842f9b3/surefire-providers/surefire-junit5/src/test/java/org/junit/platform/surefire/provider/SurefireProviderTestSuite.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit5/src/test/java/org/junit/platform/surefire/provider/SurefireProviderTestSuite.java b/surefire-providers/surefire-junit5/src/test/java/org/junit/platform/surefire/provider/SurefireProviderTestSuite.java
deleted file mode 100644
index 2d76e71..0000000
--- a/surefire-providers/surefire-junit5/src/test/java/org/junit/platform/surefire/provider/SurefireProviderTestSuite.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package org.junit.platform.surefire.provider;
-
-/*
- * 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.junit.platform.runner.IncludeClassNamePatterns;
-import org.junit.platform.runner.IncludeEngines;
-import org.junit.platform.runner.JUnitPlatform;
-import org.junit.platform.runner.SelectPackages;
-import org.junit.runner.RunWith;
-
-/**
- * Test suite for the JUnit Platform Surefire Provider.
- *
- * <h3>Logging Configuration</h3>
- *
- * <p>In order for our log4j2 configuration to be used in an IDE, you must
- * set the following system property before running any tests &mdash; for
- * example, in <em>Run Configurations</em> in Eclipse.
- *
- * <pre class="code">
- * -Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager
- * </pre>
- *
- * @since 1.0
- */
-@RunWith( JUnitPlatform.class )
-@SelectPackages( "org.junit.platform.surefire.provider" )
-@IncludeClassNamePatterns( ".*Tests?" )
-@IncludeEngines( "junit-jupiter" )
-public class SurefireProviderTestSuite
-{
-}