maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r823502 - in /maven/core-integration-testing/trunk: core-it-suite/src/test/java/org/apache/maven/it/ core-it-suite/src/test/resources/mng-3581/ core-it-suite/src/test/resources/mng-3581/plugin/ core-it-suite/src/test/resources/mng-3581/proj...
Date Fri, 09 Oct 2009 10:24:41 GMT
Author: bentmann
Date: Fri Oct  9 10:24:40 2009
New Revision: 823502

URL: http://svn.apache.org/viewvc?rev=823502&view=rev
Log:
o Refactored IT to reuse existing IT plugin

Added:
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3581/pom.xml
      - copied, changed from r823491, maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3581/project/pom.xml
Removed:
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3581/plugin/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3581/project/
Modified:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3581PluginUsesWagonDependencyTest.java
    maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-uses-wagon/pom.xml
    maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-uses-wagon/src/main/java/org/apache/maven/plugin/coreit/UsesWagonMojo.java

Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3581PluginUsesWagonDependencyTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3581PluginUsesWagonDependencyTest.java?rev=823502&r1=823501&r2=823502&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3581PluginUsesWagonDependencyTest.java
(original)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3581PluginUsesWagonDependencyTest.java
Fri Oct  9 10:24:40 2009
@@ -27,6 +27,7 @@
 public class MavenITmng3581PluginUsesWagonDependencyTest
     extends AbstractMavenIntegrationTestCase
 {
+
     public MavenITmng3581PluginUsesWagonDependencyTest()
     {
         // Not 2.0.9
@@ -34,25 +35,18 @@
     }
 
     /**
-     * Test that a plugin using a wagon directly works
+     * Test that a plugin using a specific wagon implementation directly works.
      */
-    public void testmng3581()
+    public void testit()
         throws Exception
     {
         File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3581"
);
-        File pluginDir = new File( testDir, "plugin" );
-        File projectDir = new File( testDir, "project" );
-
-        Verifier verifier = new Verifier( pluginDir.getAbsolutePath() );
-        verifier.executeGoal( "install" );
-        verifier.verifyErrorFreeLog();
-        verifier.resetStreams();
 
-        verifier = new Verifier( projectDir.getAbsolutePath() );
+        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+        verifier.setAutoclean( false );
         verifier.executeGoal( "initialize" );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
-
     }
-}
 
+}

Copied: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3581/pom.xml
(from r823491, maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3581/project/pom.xml)
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3581/pom.xml?p2=maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3581/pom.xml&p1=maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3581/project/pom.xml&r1=823491&r2=823502&rev=823502&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3581/project/pom.xml
(original)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3581/pom.xml
Fri Oct  9 10:24:40 2009
@@ -1,8 +1,8 @@
 <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.its.mng3581</groupId>
-  <artifactId>parent</artifactId>
-  <version>1.0-SNAPSHOT</version>
+  <artifactId>test</artifactId>
+  <version>1.0</version>
 
   <distributionManagement>
     <repository>
@@ -33,9 +33,9 @@
         </executions>
       </plugin>
       <plugin>
-        <groupId>org.apache.maven.its.mng3581</groupId>
-        <artifactId>maven-mng3581-plugin</artifactId>
-        <version>1</version>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-uses-wagon</artifactId>
+        <version>2.1-SNAPSHOT</version>
         <executions>
           <execution>
             <phase>initialize</phase>

Modified: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-uses-wagon/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-uses-wagon/pom.xml?rev=823502&r1=823501&r2=823502&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-uses-wagon/pom.xml
(original)
+++ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-uses-wagon/pom.xml
Fri Oct  9 10:24:40 2009
@@ -50,5 +50,10 @@
       <artifactId>wagon-ssh</artifactId>
       <version>1.0-beta-2</version>
     </dependency>
+    <dependency>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-file</artifactId>
+      <version>1.0-beta-2</version>
+    </dependency>
   </dependencies>
 </project>

Modified: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-uses-wagon/src/main/java/org/apache/maven/plugin/coreit/UsesWagonMojo.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-uses-wagon/src/main/java/org/apache/maven/plugin/coreit/UsesWagonMojo.java?rev=823502&r1=823501&r2=823502&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-uses-wagon/src/main/java/org/apache/maven/plugin/coreit/UsesWagonMojo.java
(original)
+++ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-uses-wagon/src/main/java/org/apache/maven/plugin/coreit/UsesWagonMojo.java
Fri Oct  9 10:24:40 2009
@@ -23,6 +23,7 @@
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.wagon.Wagon;
+import org.apache.maven.wagon.providers.file.FileWagon;
 import org.apache.maven.wagon.providers.ssh.jsch.ScpWagon;
 
 /**
@@ -32,6 +33,7 @@
 public class UsesWagonMojo
     extends AbstractMojo
 {
+
     /**
      * @component
      */
@@ -40,17 +42,51 @@
     public void execute()
         throws MojoExecutionException
     {
+        Wagon fileWagon;
         try
         {
-            getLog().info( "[MAVEN-CORE-IT-LOG] Looking up wagon for protocol scp" );
-            Wagon wagon = wagonManager.getWagon( "scp" );
+            getLog().info( "[MAVEN-CORE-IT-LOG] Looking up wagon for protocol file" );
+            fileWagon = wagonManager.getWagon( "file" );
+        }
+        catch( Exception e )
+        {
+            throw new MojoExecutionException( e.getMessage(), e );
+        }
+        try
+        {
+            FileWagon theWagon = (FileWagon) fileWagon;
+        }
+        catch( ClassCastException e )
+        {
+            getLog().error( "", e );
+            getLog().error( "Plugin Class Loaded by " + FileWagon.class.getClassLoader()
);
+            getLog().error( "Wagon Class Loaded by " + fileWagon.getClass().getClassLoader()
);
 
-            ScpWagon myWagon = (ScpWagon) wagon;
-            getLog().info( "[MAVEN-CORE-IT-LOG] Looked up and successfully casted scp wagon:
" + myWagon );
+            throw e;
+        }
+
+        Wagon scpWagon;
+        try
+        {
+            getLog().info( "[MAVEN-CORE-IT-LOG] Looking up wagon for protocol scp" );
+            scpWagon = wagonManager.getWagon( "scp" );
         }
         catch( Exception e )
         {
             throw new MojoExecutionException( e.getMessage(), e );
         }
+        try
+        {
+            ScpWagon theWagon = (ScpWagon) scpWagon;
+        }
+        catch( ClassCastException e )
+        {
+            getLog().error( "", e );
+            getLog().error( "Plugin Class Loaded by " + ScpWagon.class.getClassLoader() );
+            getLog().error( "Wagon Class Loaded by " + scpWagon.getClass().getClassLoader()
);
+
+            throw e;
+        }
     }
+
 }



Mime
View raw message