maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1173641 - in /maven/wagon/trunk/wagon-providers/wagon-ssh: pom.xml src/test/java/org/apache/maven/wagon/providers/ssh/jsch/EmbeddedScpWagonTest.java src/test/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagonTest.java
Date Wed, 21 Sep 2011 13:44:10 GMT
Author: olamy
Date: Wed Sep 21 13:44:10 2011
New Revision: 1173641

URL: http://svn.apache.org/viewvc?rev=1173641&view=rev
Log:
[WAGON-350] add unit test for wagon ssh with an embedded ssh server
move test with an embedded ssh server in a dedicated place
restore the previous ScpWagonTest

Added:
    maven/wagon/trunk/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/EmbeddedScpWagonTest.java
      - copied, changed from r1173640, maven/wagon/trunk/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagonTest.java
Modified:
    maven/wagon/trunk/wagon-providers/wagon-ssh/pom.xml
    maven/wagon/trunk/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagonTest.java

Modified: maven/wagon/trunk/wagon-providers/wagon-ssh/pom.xml
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-ssh/pom.xml?rev=1173641&r1=1173640&r2=1173641&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-ssh/pom.xml (original)
+++ maven/wagon/trunk/wagon-providers/wagon-ssh/pom.xml Wed Sep 21 13:44:10 2011
@@ -17,7 +17,8 @@ KIND, either express or implied.  See th
 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">
+<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>
@@ -90,16 +91,15 @@ under the License.
           <plugin>
             <artifactId>maven-surefire-plugin</artifactId>
             <configuration>
-              <!-- Tests that require an ssh server on localhost -->
+              <!-- Tests that currently doesn't work with embedded ssh server -->
               <excludes>
                 <exclude>**/SftpWagonTest.*</exclude>
                 <exclude>**/SshCommandExecutorTest.*</exclude>
                 <exclude>**/KnownHostsProviderTest.*</exclude>
-                <exclude>**/ScpWagonW*Test.*</exclude>
+                <exclude>**/ScpWagon*Test.*</exclude>
               </excludes>
               <systemPropertyVariables>
                 <java.io.tmpdir>${project.build.outputDirectory}</java.io.tmpdir>
-                <sshKeysPath>${basedir}/src/test/ssh-keys</sshKeysPath>
                 <test.user>olamy</test.user>
               </systemPropertyVariables>
             </configuration>
@@ -109,8 +109,32 @@ under the License.
     </profile>
     <profile>
       <id>windauze</id>
-
-
+      <activation>
+        <os>
+          <family>windows</family>
+        </os>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <!-- Tests that currently doesn't work with embedded ssh server and embedded
as won't work on a windauze env -->
+              <excludes>
+                <exclude>**/SftpWagonTest.*</exclude>
+                <exclude>**/SshCommandExecutorTest.*</exclude>
+                <exclude>**/KnownHostsProviderTest.*</exclude>
+                <exclude>**/ScpWagon*Test.*</exclude>
+                <exclude>**/Embedded*Test.*</exclude>
+              </excludes>
+              <systemPropertyVariables>
+                <java.io.tmpdir>${project.build.outputDirectory}</java.io.tmpdir>
+                <test.user>olamy</test.user>
+              </systemPropertyVariables>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
     </profile>
   </profiles>
 </project>

Copied: maven/wagon/trunk/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/EmbeddedScpWagonTest.java
(from r1173640, maven/wagon/trunk/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagonTest.java)
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/EmbeddedScpWagonTest.java?p2=maven/wagon/trunk/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/EmbeddedScpWagonTest.java&p1=maven/wagon/trunk/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagonTest.java&r1=1173640&r2=1173641&rev=1173641&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagonTest.java
(original)
+++ maven/wagon/trunk/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/EmbeddedScpWagonTest.java
Wed Sep 21 13:44:10 2011
@@ -36,7 +36,7 @@ import java.util.Arrays;
  * @author <a href="michal.maczka@dimatics.com">Michal Maczka</a>
  * @version $Id$
  */
-public class ScpWagonTest
+public class EmbeddedScpWagonTest
     extends StreamingWagonTestCase
 {
 
@@ -135,4 +135,9 @@ public class ScpWagonTest
     }
 
 
+    public void testStreamingWagon()
+        throws Exception
+    {
+        super.testStreamingWagon();
+    }
 }

Modified: maven/wagon/trunk/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagonTest.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagonTest.java?rev=1173641&r1=1173640&r2=1173641&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagonTest.java
(original)
+++ maven/wagon/trunk/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagonTest.java
Wed Sep 21 13:44:10 2011
@@ -20,17 +20,12 @@ package org.apache.maven.wagon.providers
  */
 
 import org.apache.maven.wagon.StreamingWagonTestCase;
-import org.apache.maven.wagon.Wagon;
 import org.apache.maven.wagon.authentication.AuthenticationInfo;
-import org.apache.maven.wagon.providers.ssh.SshServerEmbedded;
 import org.apache.maven.wagon.providers.ssh.TestData;
-import org.apache.maven.wagon.providers.ssh.knownhost.KnownHostsProvider;
 import org.apache.maven.wagon.repository.Repository;
 import org.apache.maven.wagon.resource.Resource;
 
 import java.io.File;
-import java.io.IOException;
-import java.util.Arrays;
 
 /**
  * @author <a href="michal.maczka@dimatics.com">Michal Maczka</a>
@@ -40,60 +35,6 @@ public class ScpWagonTest
     extends StreamingWagonTestCase
 {
 
-    SshServerEmbedded sshServerEmbedded;
-
-    @Override
-    protected Wagon getWagon()
-        throws Exception
-    {
-        ScpWagon scpWagon = (ScpWagon) super.getWagon();
-        scpWagon.setInteractive( false );
-        scpWagon.setKnownHostsProvider( new KnownHostsProvider()
-        {
-            public void storeKnownHosts( String contents )
-                throws IOException
-            {
-
-            }
-
-            public void setHostKeyChecking( String hostKeyChecking )
-            {
-            }
-
-            public String getHostKeyChecking()
-            {
-                return "no";
-            }
-
-            public String getContents()
-            {
-                return null;
-            }
-        } );
-        return scpWagon;
-    }
-
-    @Override
-    protected void setUp()
-        throws Exception
-    {
-        super.setUp();
-
-        String sshKeyResource = "ssh-keys/id_rsa";
-
-        sshServerEmbedded = new SshServerEmbedded( getProtocol(), Arrays.asList( sshKeyResource
) );
-
-        sshServerEmbedded.start();
-        System.out.println( "sshd on port " + sshServerEmbedded.getPort() );
-    }
-
-    @Override
-    protected void tearDownWagonTestingFixtures()
-        throws Exception
-    {
-        sshServerEmbedded.stop( true );
-    }
-
     protected String getProtocol()
     {
         return "scp";
@@ -102,13 +43,12 @@ public class ScpWagonTest
     @Override
     protected int getTestRepositoryPort()
     {
-        return sshServerEmbedded.getPort();
+        return 0;  // not used
     }
 
-
     public String getTestRepositoryUrl()
     {
-        return TestData.getTestRepositoryUrl( sshServerEmbedded.getPort() );
+        return TestData.getTestRepositoryUrl( getTestRepositoryPort() );
     }
 
     protected AuthenticationInfo getAuthInfo()
@@ -133,6 +73,4 @@ public class ScpWagonTest
     {
         return new File( repository.getBasedir(), resource.getName() ).lastModified();
     }
-
-
 }



Mime
View raw message