maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dfabul...@apache.org
Subject svn commit: r602619 - in /maven/surefire/trunk: ./ surefire-api/ surefire-booter/ surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ surefire-integration-tests/src/test/resources/plexus-conflict/ surefire-integration-tests/src/test...
Date Sun, 09 Dec 2007 03:18:47 GMT
Author: dfabulich
Date: Sat Dec  8 19:18:44 2007
New Revision: 602619

URL: http://svn.apache.org/viewvc?rev=602619&view=rev
Log:
[SUREFIRE-347] [SUREFIRE-334] Made a plexus conflict integration test to confirm these bugs.
 SUREFIRE-334 reproduced, SUREFIRE-347 didn't (though it is filed against 2.3).  Resolved
by shading surefire-booter and surefire-api deps (just commons-lang and plexus-utils, now
that we no longer depend on plexus-archiver).  Will also need to port this to 2.3 branch.

Added:
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/PlexusConflictTest.java
      - copied, changed from r602310, maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/DefaultConfigurationTest.java
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/plexus-conflict/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/plexus-conflict/pom.xml
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/plexus-conflict/src/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/plexus-conflict/src/main/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/plexus-conflict/src/main/java/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/plexus-conflict/src/main/java/plexusConflict/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/plexus-conflict/src/main/java/plexusConflict/CommandlineExtender.java
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/plexus-conflict/src/test/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/plexus-conflict/src/test/java/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/plexus-conflict/src/test/java/plexusConflict/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/plexus-conflict/src/test/java/plexusConflict/BasicTest.java
Modified:
    maven/surefire/trunk/pom.xml
    maven/surefire/trunk/surefire-api/pom.xml
    maven/surefire/trunk/surefire-booter/pom.xml

Modified: maven/surefire/trunk/pom.xml
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/pom.xml?rev=602619&r1=602618&r2=602619&view=diff
==============================================================================
--- maven/surefire/trunk/pom.xml (original)
+++ maven/surefire/trunk/pom.xml Sat Dec  8 19:18:44 2007
@@ -175,14 +175,13 @@
       </build>
     </profile>
   </profiles>
-  <repositories>
-    <repository>
+  <pluginRepositories>
+    <pluginRepository>
       <releases>
         <enabled>false</enabled>
       </releases>
-      <id>codehaus.snapshots</id>
-      <name>Codehaus Snapshot Development Repository</name>
-      <url>http://snapshots.repository.codehaus.org</url>
-    </repository>
-  </repositories>
+      <id>apache.snapshots</id>
+      <url>http://people.apache.org/repo/m2-snapshot-repository/</url>
+    </pluginRepository>
+  </pluginRepositories>
 </project>

Modified: maven/surefire/trunk/surefire-api/pom.xml
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/pom.xml?rev=602619&r1=602618&r2=602619&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/pom.xml (original)
+++ maven/surefire/trunk/surefire-api/pom.xml Sat Dec  8 19:18:44 2007
@@ -26,6 +26,41 @@
   <modelVersion>4.0.0</modelVersion>
   <artifactId>surefire-api</artifactId>
   <name>SureFire API</name>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>1.0-alpha-14-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <artifactSet>
+                <includes>
+                  <include>org.codehaus.plexus:plexus-utils</include>
+                  <include>commons-lang:commons-lang</include>
+                </includes>
+              </artifactSet>
+              <relocations>
+                <relocation>
+                  <pattern>org.codehaus.plexus.util</pattern>
+                  <shadedPattern>org.apache.maven.surefire.shade.org.codehaus.plexus.util</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>org.apache.commons.lang</pattern>
+                  <shadedPattern>org.apache.maven.surefire.shade.org.apache.commons.lang</shadedPattern>
+                </relocation>
+              </relocations>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
   <dependencies>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>

Modified: maven/surefire/trunk/surefire-booter/pom.xml
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/pom.xml?rev=602619&r1=602618&r2=602619&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/pom.xml (original)
+++ maven/surefire/trunk/surefire-booter/pom.xml Sat Dec  8 19:18:44 2007
@@ -7,6 +7,36 @@
   <modelVersion>4.0.0</modelVersion>
   <artifactId>surefire-booter</artifactId>
   <name>SureFire Booter</name>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>1.0-alpha-14-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <artifactSet>
+                <includes>
+                  <include>org.codehaus.plexus:plexus-utils</include>
+                </includes>
+              </artifactSet>
+              <relocations>
+                <relocation>
+                  <pattern>org.codehaus.plexus.util</pattern>
+                  <shadedPattern>org.apache.maven.surefire.booter.shade.org.codehaus.plexus.util</shadedPattern>
+                </relocation>
+              </relocations>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
   <dependencies>
     <dependency>
       <groupId>org.apache.maven.surefire</groupId>

Copied: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/PlexusConflictTest.java
(from r602310, maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/DefaultConfigurationTest.java)
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/PlexusConflictTest.java?p2=maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/PlexusConflictTest.java&p1=maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/DefaultConfigurationTest.java&r1=602310&r2=602619&rev=602619&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/DefaultConfigurationTest.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/PlexusConflictTest.java
Sat Dec  8 19:18:44 2007
@@ -1,30 +1,47 @@
 package org.apache.maven.surefire.its;
 
-import java.io.File;
-
 import org.apache.maven.integrationtests.AbstractMavenIntegrationTestCase;
 import org.apache.maven.it.Verifier;
 import org.apache.maven.it.util.ResourceExtractor;
 
+import java.io.File;
+import java.util.ArrayList;
+
 /**
- * Test basic default configuration, runs the JUnit 3 test in the src/test directory.
- * 
+ * Test library using a conflicting version of plexus-utils
+ *
  * @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
- * 
+ *
  */
-public class DefaultConfigurationTest
+public class PlexusConflictTest
     extends AbstractMavenIntegrationTestCase
 {
-    public void testDefaultConfiguration ()
+    public void testPlexusConflict ()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/default-configuration"
);
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/plexus-conflict"
);
 
         Verifier verifier = new Verifier( testDir.getAbsolutePath() );
         verifier.executeGoal( "test" );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
-        
-        HelperAssertions.assertTestSuiteResults( 1, 0, 0, 0, testDir );        
+
+        HelperAssertions.assertTestSuiteResults( 1, 0, 0, 0, testDir );
+    }
+
+    public void testPlexusConflictSystemClassLoader ()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/plexus-conflict"
);
+
+        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+        ArrayList goals = new ArrayList();
+        goals.add( "test" );
+        goals.add( "-Dsurefire.useSystemClassLoader=true" );
+        verifier.executeGoals( goals );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        HelperAssertions.assertTestSuiteResults( 1, 0, 0, 0, testDir );
     }
-}
+}
\ No newline at end of file

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/plexus-conflict/pom.xml
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/plexus-conflict/pom.xml?rev=602619&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/plexus-conflict/pom.xml
(added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/plexus-conflict/pom.xml
Sat Dec  8 19:18:44 2007
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.plugins.surefire</groupId>
+  <artifactId>plexus-conflict</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <name>Test for plexus conflict</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+      <version>1.0.4</version>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+</project>

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/plexus-conflict/src/main/java/plexusConflict/CommandlineExtender.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/plexus-conflict/src/main/java/plexusConflict/CommandlineExtender.java?rev=602619&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/plexus-conflict/src/main/java/plexusConflict/CommandlineExtender.java
(added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/plexus-conflict/src/main/java/plexusConflict/CommandlineExtender.java
Sat Dec  8 19:18:44 2007
@@ -0,0 +1,14 @@
+package plexusConflict;
+
+import org.codehaus.plexus.util.cli.Commandline;
+
+/**
+ * Conflict with latest version of plexus by using modified protected class.
+ */
+public class CommandlineExtender extends Commandline
+{
+    public CommandlineExtender() {
+        // In 1.0.4, Commandline.envVars was a Vector; in 1.4.x, it's a Map.
+        super.envVars.add("");
+    }
+}

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/plexus-conflict/src/test/java/plexusConflict/BasicTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/plexus-conflict/src/test/java/plexusConflict/BasicTest.java?rev=602619&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/plexus-conflict/src/test/java/plexusConflict/BasicTest.java
(added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/plexus-conflict/src/test/java/plexusConflict/BasicTest.java
Sat Dec  8 19:18:44 2007
@@ -0,0 +1,17 @@
+package plexusConflict;
+
+import junit.extensions.TestSetup;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+public class BasicTest
+    extends TestCase
+{
+
+    public void testPlexusConflict()
+    {
+        CommandlineExtender ce = new CommandlineExtender();
+    }
+
+}



Mime
View raw message