You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by br...@apache.org on 2008/03/28 13:45:51 UTC
svn commit: r642212 - in /maven/core-integration-testing/trunk: ./
core-integration-testing-wagon/ core-integration-testing-wagon/src/
core-integration-testing-wagon/src/main/
core-integration-testing-wagon/src/main/java/
core-integration-testing-wagon...
Author: brett
Date: Fri Mar 28 05:45:46 2008
New Revision: 642212
URL: http://svn.apache.org/viewvc?rev=642212&view=rev
Log:
[MNG-3485] add the integration test for the issue with overriding the wagon with an extension, and corresponding support artifact
Added:
maven/core-integration-testing/trunk/core-integration-testing-wagon/ (with props)
maven/core-integration-testing/trunk/core-integration-testing-wagon/pom.xml (with props)
maven/core-integration-testing/trunk/core-integration-testing-wagon/src/
maven/core-integration-testing/trunk/core-integration-testing-wagon/src/main/
maven/core-integration-testing/trunk/core-integration-testing-wagon/src/main/java/
maven/core-integration-testing/trunk/core-integration-testing-wagon/src/main/java/org/
maven/core-integration-testing/trunk/core-integration-testing-wagon/src/main/java/org/apache/
maven/core-integration-testing/trunk/core-integration-testing-wagon/src/main/java/org/apache/maven/
maven/core-integration-testing/trunk/core-integration-testing-wagon/src/main/java/org/apache/maven/wagon/
maven/core-integration-testing/trunk/core-integration-testing-wagon/src/main/java/org/apache/maven/wagon/providers/
maven/core-integration-testing/trunk/core-integration-testing-wagon/src/main/java/org/apache/maven/wagon/providers/ssh/
maven/core-integration-testing/trunk/core-integration-testing-wagon/src/main/java/org/apache/maven/wagon/providers/ssh/external/
maven/core-integration-testing/trunk/core-integration-testing-wagon/src/main/java/org/apache/maven/wagon/providers/ssh/external/ScpExternalWagon.java (with props)
maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3485OverrideWagonExtensionTest.java (with props)
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/ (with props)
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/pom.xml (with props)
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/src/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/src/main/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/src/main/java/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/src/main/java/org/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/src/main/java/org/apache/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/src/main/java/org/apache/maven/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/src/main/java/org/apache/maven/its/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/src/main/java/org/apache/maven/its/mng3485/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/src/main/java/org/apache/maven/its/mng3485/App.java (with props)
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/src/test/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/src/test/java/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/src/test/java/org/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/src/test/java/org/apache/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/src/test/java/org/apache/maven/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/src/test/java/org/apache/maven/its/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/src/test/java/org/apache/maven/its/mng3485/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/src/test/java/org/apache/maven/its/mng3485/AppTest.java (with props)
Modified:
maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java
maven/core-integration-testing/trunk/maven-integration-test-helper/ (props changed)
maven/core-integration-testing/trunk/pom.xml
Propchange: maven/core-integration-testing/trunk/core-integration-testing-wagon/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 05:45:46 2008
@@ -0,0 +1,4 @@
+.settings
+.classpath
+.project
+target
Added: maven/core-integration-testing/trunk/core-integration-testing-wagon/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-testing-wagon/pom.xml?rev=642212&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-testing-wagon/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-integration-testing-wagon/pom.xml Fri Mar 28 05:45:46 2008
@@ -0,0 +1,38 @@
+<?xml version="1.0"?><project>
+ <parent>
+ <artifactId>core-integration-testing</artifactId>
+ <groupId>org.apache.maven.its</groupId>
+ <version>2.1-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>core-integration-testing-wagon</artifactId>
+ <name>core-integration-testing-wagon</name>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-provider-api</artifactId>
+ <version>1.0-beta-2</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-maven-plugin</artifactId>
+ <version>1.3.5</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>descriptor</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: maven/core-integration-testing/trunk/core-integration-testing-wagon/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: maven/core-integration-testing/trunk/core-integration-testing-wagon/src/main/java/org/apache/maven/wagon/providers/ssh/external/ScpExternalWagon.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-testing-wagon/src/main/java/org/apache/maven/wagon/providers/ssh/external/ScpExternalWagon.java?rev=642212&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-testing-wagon/src/main/java/org/apache/maven/wagon/providers/ssh/external/ScpExternalWagon.java (added)
+++ maven/core-integration-testing/trunk/core-integration-testing-wagon/src/main/java/org/apache/maven/wagon/providers/ssh/external/ScpExternalWagon.java Fri Mar 28 05:45:46 2008
@@ -0,0 +1,117 @@
+package org.apache.maven.wagon.providers.ssh.external;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import org.apache.maven.wagon.AbstractWagon;
+import org.apache.maven.wagon.ConnectionException;
+import org.apache.maven.wagon.InputData;
+import org.apache.maven.wagon.OutputData;
+import org.apache.maven.wagon.ResourceDoesNotExistException;
+import org.apache.maven.wagon.TransferFailedException;
+import org.apache.maven.wagon.authentication.AuthenticationException;
+import org.apache.maven.wagon.authorization.AuthorizationException;
+import org.apache.maven.wagon.resource.Resource;
+import org.codehaus.plexus.util.StringInputStream;
+
+/**
+ * NOTE: Plexus will only pick this correctly if the Class package and name are the same as that in core. This is
+ * because the core component descriptor is read, but the class is read from the latter JAR.
+ *
+ * @plexus.component role="org.apache.maven.wagon.Wagon" role-hint="scpexe"
+ */
+public class ScpExternalWagon
+ extends AbstractWagon
+{
+ public void get( String resourceName, File destination )
+ throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
+ {
+ InputData inputData = new InputData();
+
+ Resource resource = new Resource( resourceName );
+
+ fireGetInitiated( resource, destination );
+
+ inputData.setResource( resource );
+
+ fillInputData( inputData );
+
+ InputStream is = inputData.getInputStream();
+
+ if ( is == null )
+ {
+ throw new TransferFailedException( getRepository().getUrl()
+ + " - Could not open input stream for resource: '" + resource + "'" );
+ }
+
+ createParentDirectories( destination );
+
+ getTransfer( inputData.getResource(), destination, is );
+ }
+
+ public boolean getIfNewer( String resourceName, File destination, long timestamp )
+ throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
+ {
+ return false;
+ }
+
+ public void put( File source, String resourceName )
+ throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
+ {
+ OutputData outputData = new OutputData();
+
+ Resource resource = new Resource( resourceName );
+
+ firePutInitiated( resource, source );
+
+ outputData.setResource( resource );
+
+ fillOutputData( outputData );
+
+ OutputStream os = outputData.getOutputStream();
+
+ if ( os == null )
+ {
+ throw new TransferFailedException( getRepository().getUrl()
+ + " - Could not open output stream for resource: '" + resource + "'" );
+ }
+
+ putTransfer( outputData.getResource(), source, os, true );
+ }
+
+ public void closeConnection()
+ throws ConnectionException
+ {
+ File f = new File( "target/wagon-data" );
+ try
+ {
+ f.createNewFile();
+ }
+ catch ( IOException e )
+ {
+ throw new ConnectionException( e.getMessage(), e );
+ }
+ }
+
+ public void fillInputData( InputData inputData )
+ throws TransferFailedException, ResourceDoesNotExistException
+ {
+ inputData.setInputStream( new StringInputStream( "<metadata />" ) );
+ }
+
+ public void fillOutputData( OutputData outputData )
+ throws TransferFailedException
+ {
+ outputData.setOutputStream( new ByteArrayOutputStream() );
+ }
+
+ public void openConnection()
+ throws ConnectionException, AuthenticationException
+ {
+ // TODO Auto-generated method stub
+
+ }
+}
Propchange: maven/core-integration-testing/trunk/core-integration-testing-wagon/src/main/java/org/apache/maven/wagon/providers/ssh/external/ScpExternalWagon.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java?rev=642212&r1=642211&r2=642212&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java (original)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java Fri Mar 28 05:45:46 2008
@@ -65,6 +65,7 @@
* a fail fast technique as well.
*/
+ suite.addTestSuite( MavenITmng3485OverrideWagonExtensionTest.class );
suite.addTestSuite( MavenITmng3473PluginReportCrash.class );
suite.addTestSuite( MavenITmng3428PluginDescriptorArtifactsIncompleteTest.class );
suite.addTestSuite( MavenITmng3426PluginsClasspathOverrideTest.class );
Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3485OverrideWagonExtensionTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3485OverrideWagonExtensionTest.java?rev=642212&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3485OverrideWagonExtensionTest.java (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3485OverrideWagonExtensionTest.java Fri Mar 28 05:45:46 2008
@@ -0,0 +1,39 @@
+package org.apache.maven.integrationtests;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
+import org.apache.maven.integrationtests.AbstractMavenIntegrationTestCase;
+import org.apache.maven.it.Verifier;
+import org.apache.maven.it.util.ResourceExtractor;
+
+public class MavenITmng3485OverrideWagonExtensionTest
+ extends AbstractMavenIntegrationTestCase
+{
+ public MavenITmng3485OverrideWagonExtensionTest()
+ throws InvalidVersionSpecificationException
+ {
+ super( "(2.0.8,)" ); // only test in 2.0.9+
+ }
+
+ public void testitMNG3485 ()
+ throws Exception
+ {
+ File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3485-overrideWagonExtension" );
+
+ Verifier verifier;
+
+ verifier = new Verifier( testDir.getAbsolutePath() );
+
+ List cliOptions = new ArrayList();
+ verifier.setCliOptions( cliOptions );
+ verifier.executeGoal( "deploy" );
+
+ verifier.assertFilePresent( "target/wagon-data" );
+ verifier.verifyErrorFreeLog();
+
+ verifier.resetStreams();
+ }
+}
Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3485OverrideWagonExtensionTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 05:45:46 2008
@@ -0,0 +1 @@
+target
Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/pom.xml?rev=642212&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/pom.xml Fri Mar 28 05:45:46 2008
@@ -0,0 +1,31 @@
+<?xml version="1.0"?><project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.maven.its.mng3485</groupId>
+ <version>1.0-SNAPSHOT</version>
+ <artifactId>test-project</artifactId>
+ <name>test-project</name>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.its</groupId>
+ <artifactId>core-integration-testing-wagon</artifactId>
+ <version>2.1-SNAPSHOT</version>
+ </extension>
+ </extensions>
+ </build>
+ <distributionManagement>
+ <repository>
+ <id>id</id>
+ <!-- Note this won't actually be used if it passes -->
+ <url>scpexe://foo.bar/path</url>
+ </repository>
+ </distributionManagement>
+</project>
Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/src/main/java/org/apache/maven/its/mng3485/App.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/src/main/java/org/apache/maven/its/mng3485/App.java?rev=642212&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/src/main/java/org/apache/maven/its/mng3485/App.java (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/src/main/java/org/apache/maven/its/mng3485/App.java Fri Mar 28 05:45:46 2008
@@ -0,0 +1,13 @@
+package org.apache.maven.its.mng3485;
+
+/**
+ * Hello world!
+ *
+ */
+public class App
+{
+ public static void main( String[] args )
+ {
+ System.out.println( "Hello World!" );
+ }
+}
Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/src/main/java/org/apache/maven/its/mng3485/App.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/src/test/java/org/apache/maven/its/mng3485/AppTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/src/test/java/org/apache/maven/its/mng3485/AppTest.java?rev=642212&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/src/test/java/org/apache/maven/its/mng3485/AppTest.java (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/src/test/java/org/apache/maven/its/mng3485/AppTest.java Fri Mar 28 05:45:46 2008
@@ -0,0 +1,38 @@
+package org.apache.maven.its.mng3485;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public AppTest( String testName )
+ {
+ super( testName );
+ }
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite()
+ {
+ return new TestSuite( AppTest.class );
+ }
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testApp()
+ {
+ assertTrue( true );
+ }
+}
Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3485-overrideWagonExtension/src/test/java/org/apache/maven/its/mng3485/AppTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/core-integration-testing/trunk/maven-integration-test-helper/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Mar 28 05:45:46 2008
@@ -1,4 +1,5 @@
target
*.iml
.project
+.settings
.classpath
Modified: maven/core-integration-testing/trunk/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/pom.xml?rev=642212&r1=642211&r2=642212&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/pom.xml (original)
+++ maven/core-integration-testing/trunk/pom.xml Fri Mar 28 05:45:46 2008
@@ -47,6 +47,7 @@
</issueManagement>
<modules>
<module>core-integration-testing-plugins</module>
+ <module>core-integration-testing-wagon</module>
<module>core-integration-tests</module>
<module>core-integration-testing-support</module>
<module>maven-integration-test-helper</module>