You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sj...@apache.org on 2022/02/08 21:32:16 UTC

[maven-surefire] 01/01: [SUREFIRE-2006] Don't use Services Transformer in shadefire

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

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

commit fdaf79d80f4722c5389fb0374d44afcfd3aa63f5
Author: Slawomir Jaranowski <s....@gmail.com>
AuthorDate: Tue Feb 8 22:29:37 2022 +0100

    [SUREFIRE-2006] Don't use Services Transformer in shadefire
---
 .../org/apache/maven/surefire/its/PojoSimpleIT.java  | 14 ++++++++------
 surefire-its/src/test/resources/pojo-simple/pom.xml  |  7 +++++++
 surefire-shadefire/pom.xml                           |  3 ---
 ...surefire.spi.MasterProcessChannelProcessorFactory | 20 ++++++++++++++++++++
 ...ache.maven.surefire.api.provider.SurefireProvider | 19 +++++++++++++++++++
 5 files changed, 54 insertions(+), 9 deletions(-)

diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/PojoSimpleIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/PojoSimpleIT.java
index 6905730..341107b 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/PojoSimpleIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/PojoSimpleIT.java
@@ -38,11 +38,13 @@ public class PojoSimpleIT
     public void twoTestsWithFixtures() throws VerificationException
     {
         unpack( "pojo-simple" )
-                .executeTest()
-                .assertTestSuiteResults( 2, 0, 1, 0 )
-                .assertThatLogLine( containsString( "setUp called 1" ), is( 1 ) )
-                .assertThatLogLine( containsString( "setUp called 2" ), is( 1 ) )
-                .assertThatLogLine( containsString( "tearDown called 1" ), is( 1 ) )
-                .assertThatLogLine( containsString( "tearDown called 2" ), is( 1 ) );
+            .executeTest()
+            .assertTestSuiteResults( 2, 0, 1, 0 )
+            .assertThatLogLine( containsString(
+                "[INFO] Using configured provider org.apache.maven.shadefire.surefire.junit.JUnit3Provider" ), is( 1 ) )
+            .assertThatLogLine( containsString( "setUp called 1" ), is( 1 ) )
+            .assertThatLogLine( containsString( "setUp called 2" ), is( 1 ) )
+            .assertThatLogLine( containsString( "tearDown called 1" ), is( 1 ) )
+            .assertThatLogLine( containsString( "tearDown called 2" ), is( 1 ) );
     }
 }
diff --git a/surefire-its/src/test/resources/pojo-simple/pom.xml b/surefire-its/src/test/resources/pojo-simple/pom.xml
index 45986ac..7696deb 100644
--- a/surefire-its/src/test/resources/pojo-simple/pom.xml
+++ b/surefire-its/src/test/resources/pojo-simple/pom.xml
@@ -44,6 +44,13 @@
         <configuration>
           <testFailureIgnore>true</testFailureIgnore>
         </configuration>
+        <dependencies>
+          <dependency>
+            <groupId>org.apache.maven.surefire</groupId>
+            <artifactId>surefire-shadefire</artifactId>
+            <version>${surefire.version}</version>
+          </dependency>
+        </dependencies>
       </plugin>
     </plugins>
   </build>
diff --git a/surefire-shadefire/pom.xml b/surefire-shadefire/pom.xml
index 164e35c..939ee1f 100644
--- a/surefire-shadefire/pom.xml
+++ b/surefire-shadefire/pom.xml
@@ -88,9 +88,6 @@
                   <shadedPattern>org.apache.maven.shadefire</shadedPattern>
                 </relocation>
               </relocations>
-                <transformers>
-                    <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
-                </transformers>
             </configuration>
           </execution>
         </executions>
diff --git a/surefire-shadefire/src/main/resources/META-INF/services/org.apache.maven.shadefire.surefire.spi.MasterProcessChannelProcessorFactory b/surefire-shadefire/src/main/resources/META-INF/services/org.apache.maven.shadefire.surefire.spi.MasterProcessChannelProcessorFactory
new file mode 100644
index 0000000..5fe2d23
--- /dev/null
+++ b/surefire-shadefire/src/main/resources/META-INF/services/org.apache.maven.shadefire.surefire.spi.MasterProcessChannelProcessorFactory
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+org.apache.maven.shadefire.surefire.booter.spi.LegacyMasterProcessChannelProcessorFactory
+org.apache.maven.shadefire.surefire.booter.spi.SurefireMasterProcessChannelProcessorFactory
diff --git a/surefire-shadefire/src/main/resources/META-INF/services/org.apache.maven.surefire.api.provider.SurefireProvider b/surefire-shadefire/src/main/resources/META-INF/services/org.apache.maven.surefire.api.provider.SurefireProvider
new file mode 100644
index 0000000..1445853
--- /dev/null
+++ b/surefire-shadefire/src/main/resources/META-INF/services/org.apache.maven.surefire.api.provider.SurefireProvider
@@ -0,0 +1,19 @@
+#
+# 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.
+#
+org.apache.maven.shadefire.surefire.junit.JUnit3Provider