maven-wagon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject cvs commit: maven-wagon/wagon-providers/ftp/src/test/java/org/apache/maven/wagon/providers/ftp FtpWagonTest.xml FtpWagonTest.java
Date Wed, 21 Apr 2004 02:51:41 GMT
jvanzyl     2004/04/20 19:51:41

  Modified:    wagon-providers/ftp project.xml
               wagon-providers/ftp/src/main/java/org/apache/maven/wagon/providers/ftp
                        FtpWagon.java
               wagon-providers/ftp/src/test/java/org/apache/maven/wagon/providers/ftp
                        FtpWagonTest.java
  Added:       wagon-providers/ftp/src/test/java/org/apache/maven/wagon/providers/ftp
                        FtpWagonTest.xml
  Log:
  o the round trip testing for the ftp wagon is now working as we are now
    using the embedded ftp server component from plexus for testing the
    ftp wagon.
  
  Revision  Changes    Path
  1.2       +89 -1     maven-wagon/wagon-providers/ftp/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-providers/ftp/project.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- project.xml	30 Mar 2004 14:43:05 -0000	1.1
  +++ project.xml	21 Apr 2004 02:51:40 -0000	1.2
  @@ -7,6 +7,7 @@
     <groupId>maven</groupId>
     <artifactId>wagon-ftp</artifactId>
     <name>Wagon FTP Provider</name>
  +  <version>1.0-SNAPSHOT</version>
     <currentVersion>1.0-SNAPSHOT</currentVersion>
     <description></description>
     <shortDescription>Provider for FTP protocol for Wagon</shortDescription>
  @@ -43,8 +44,95 @@
       <dependency>
         <groupId>commons-net</groupId>
         <artifactId>commons-net</artifactId>
  -      <version>1.0.0</version>
  +      <version>1.1.0</version>
       </dependency>
  +
  +    <!-- Embedded Ftp Server -->
  +
  +    <dependency>
  +      <groupId>plexus</groupId>
  +      <artifactId>plexus-ftp</artifactId>
  +      <version>1.0-SNAPSHOT</version>
  +    </dependency>
  +
  +    <dependency>
  +      <groupId>avalon</groupId>
  +      <artifactId>avalon-framework</artifactId>
  +      <version>4.1.4</version>
  +    </dependency>
  +
  +    <dependency>
  +      <groupId>cornerstone-threads</groupId>
  +      <artifactId>cornerstone-threads-api</artifactId>
  +      <version>1.0</version>
  +    </dependency>
  +
  +    <dependency>
  +      <groupId>cornerstone-threads</groupId>
  +      <artifactId>cornerstone-threads-impl</artifactId>
  +      <version>1.0</version>
  +    </dependency>
  +
  +    <dependency>
  +      <groupId>excalibur-thread</groupId>
  +      <artifactId>excalibur-thread</artifactId>
  +      <version>1.1.1</version>
  +    </dependency>
  +
  +    <dependency>
  +      <groupId>excalibur-pool</groupId>
  +      <artifactId>excalibur-pool-api</artifactId>
  +      <version>2.0</version>
  +    </dependency>
  +
  +    <dependency>
  +      <groupId>excalibur-pool</groupId>
  +      <artifactId>excalibur-pool-impl</artifactId>
  +      <version>2.0</version>
  +    </dependency>
  +
  +    <dependency>
  +      <groupId>cornerstone-connection</groupId>
  +      <artifactId>cornerstone-connection-api</artifactId>
  +      <version>1.0</version>
  +    </dependency>
  +
  +    <dependency>
  +      <groupId>cornerstone-connection</groupId>
  +      <artifactId>cornerstone-connection-impl</artifactId>
  +      <version>1.0</version>
  +    </dependency>
  +
  +    <dependency>
  +      <groupId>cornerstone-sockets</groupId>
  +      <artifactId>cornerstone-sockets-api</artifactId>
  +      <version>1.0</version>
  +    </dependency>
  +
  +    <dependency>
  +      <groupId>cornerstone-sockets</groupId>
  +      <artifactId>cornerstone-sockets-impl</artifactId>
  +      <version>1.0</version>
  +    </dependency>
  +
  +    <dependency>
  +      <groupId>concurrent</groupId>
  +      <artifactId>concurrent</artifactId>
  +      <version>1.3.2</version>
  +    </dependency>
  +
  +    <dependency>
  +      <groupId>plexus</groupId>
  +      <artifactId>plexus-avalon-personality</artifactId>
  +      <version>0.12</version>
  +    </dependency>
  +
  +    <dependency>
  +      <groupId>commons-collections</groupId>
  +      <artifactId>commons-collections</artifactId>
  +      <version>3.0</version>
  +    </dependency>
  +
     </dependencies>
   
   </project>
  
  
  
  1.2       +5 -11     maven-wagon/wagon-providers/ftp/src/main/java/org/apache/maven/wagon/providers/ftp/FtpWagon.java
  
  Index: FtpWagon.java
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-providers/ftp/src/main/java/org/apache/maven/wagon/providers/ftp/FtpWagon.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FtpWagon.java	30 Mar 2004 14:43:05 -0000	1.1
  +++ FtpWagon.java	21 Apr 2004 02:51:40 -0000	1.2
  @@ -76,7 +76,7 @@
               // success.
               int reply = ftp.getReplyCode();
   
  -            if ( FTPReply.isPositiveCompletion( reply ) == false )
  +            if ( !FTPReply.isPositiveCompletion( reply ) )
               {
                   fireSessionConnectionRefused();
   
  @@ -151,7 +151,6 @@
               // This is a NPE rethink shutting down the streams
               ftp.disconnect();
           }
  -
       }
   
       public String[] getSupportedProtocols()
  @@ -159,15 +158,6 @@
           return new String[]{"ftp"};
       }
   
  -    public void closePutTransferStreams( InputStream is, OutputStream os )
  -    {
  -        // Shutting down the output stream after the transfer causes
  -        // an NPE when the ftp server disconnects. So we only shut down
  -        // the input stream after a put transfer.
  -
  -        shutdownStream( is );
  -    }
  -
       public OutputStream getOutputStream( Artifact artifact )
           throws TransferFailedException
       {
  @@ -201,6 +191,10 @@
               }
   
               os = ftp.storeFileStream( resource );
  +
  +            System.out.println( "resource = " + resource );
  +
  +            System.out.println( "os = " + os );
           }
           catch ( Exception e )
           {
  
  
  
  1.2       +13 -4     maven-wagon/wagon-providers/ftp/src/test/java/org/apache/maven/wagon/providers/ftp/FtpWagonTest.java
  
  Index: FtpWagonTest.java
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-providers/ftp/src/test/java/org/apache/maven/wagon/providers/ftp/FtpWagonTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FtpWagonTest.java	30 Mar 2004 14:43:05 -0000	1.1
  +++ FtpWagonTest.java	21 Apr 2004 02:51:41 -0000	1.2
  @@ -23,6 +23,7 @@
   import org.apache.maven.wagon.artifact.DefaultArtifact;
   import org.apache.maven.wagon.events.Debug;
   import org.apache.maven.wagon.repository.Repository;
  +import org.apache.ftpserver.interfaces.FtpServerInterface;
   import org.codehaus.plexus.PlexusTestCase;
   
   import java.io.File;
  @@ -39,18 +40,26 @@
           return "ftp";
       }
   
  +    protected void setUp()
  +        throws Exception
  +    {
  +        super.setUp();
  +
  +        FtpServerInterface server = (FtpServerInterface)lookup( FtpServerInterface.ROLE
);
  +    }
  +
       protected String getTestRepositoryUrl()
       {
  -        return "ftp://localhost/ftp-repo";
  +        return "ftp://localhost:10021";
       }
   
       public AuthenticationInfo getAuthInfo()
       {
           AuthenticationInfo authInfo = new AuthenticationInfo();
   
  -        authInfo.setUserName( "" );
  +        authInfo.setUserName( "admin" );
   
  -        authInfo.setPassword( "" );
  +        authInfo.setPassword( "admin" );
   
           return authInfo;
       }
  
  
  
  1.1                  maven-wagon/wagon-providers/ftp/src/test/java/org/apache/maven/wagon/providers/ftp/FtpWagonTest.xml
  
  Index: FtpWagonTest.xml
  ===================================================================
  <plexus>
    <lifecycle-handler-manager implementation='org.codehaus.plexus.lifecycle.DefaultLifecycleHandlerManager'>
      <default-lifecycle-handler-id>avalon</default-lifecycle-handler-id>
      <lifecycle-handlers>
        <lifecycle-handler implementation='org.codehaus.plexus.personality.avalon.AvalonLifecycleHandler'>
          <id>avalon</id>
          <name>Avalon Lifecycle Handler</name>
          <begin-segment>
            <phase implementation='org.codehaus.plexus.personality.avalon.lifecycle.phase.LogEnablePhase'/>
            <phase implementation='org.codehaus.plexus.personality.avalon.lifecycle.phase.ContextualizePhase'/>
            <phase implementation='org.codehaus.plexus.personality.avalon.lifecycle.phase.ServicePhase'/>
            <phase implementation='org.codehaus.plexus.personality.avalon.lifecycle.phase.ComposePhase'/>
            <phase implementation='org.codehaus.plexus.personality.avalon.lifecycle.phase.ConfigurePhase'/>
            <phase implementation='org.codehaus.plexus.personality.avalon.lifecycle.phase.InitializePhase'/>
            <phase implementation='org.codehaus.plexus.personality.avalon.lifecycle.phase.StartPhase'/>
          </begin-segment>
          <suspend-segment>
            <phase implementation='org.codehaus.plexus.personality.avalon.lifecycle.phase.SuspendPhase'/>
          </suspend-segment>
          <resume-segment>
            <phase implementation='org.codehaus.plexus.personality.avalon.lifecycle.phase.ResumePhase'/>
            <phase implementation='org.codehaus.plexus.personality.avalon.lifecycle.phase.RecontextualizePhase'/>
            <phase implementation='org.codehaus.plexus.personality.avalon.lifecycle.phase.ReconfigurePhase'/>
          </resume-segment>
          <end-segment>
            <phase implementation='org.codehaus.plexus.personality.avalon.lifecycle.phase.StopPhase'/>
            <phase implementation='org.codehaus.plexus.personality.avalon.lifecycle.phase.DisposePhase'/>
          </end-segment>
        </lifecycle-handler>
      </lifecycle-handlers>
    </lifecycle-handler-manager>
  
    <load-on-start>
      <component>
        <role>org.apache.avalon.cornerstone.services.threads.ThreadManager</role>
      </component>
      <component>
        <role>org.apache.avalon.cornerstone.services.connection.ConnectionManager</role>
      </component>
      <component>
        <role>org.apache.avalon.cornerstone.services.sockets.SocketManager</role>
      </component>
      <component>
        <role>org.apache.ftpserver.usermanager.UserManagerInterface</role>
      </component>
      <component>
        <role>org.apache.ftpserver.ip.IpRestrictorInterface</role>
      </component>
    </load-on-start>
  
    <components>
  
      <component>
        <role>org.apache.avalon.cornerstone.services.threads.ThreadManager</role>
        <implementation>org.apache.avalon.cornerstone.blocks.threads.DefaultThreadManager</implementation>
  
        <configuration>
          <thread-group>
            <name>default</name>
  
            <!-- normal priority = 5, max-priority = 10 -->
            <priority>5</priority>
  
            <!-- are threads deamon threads ? -->
            <is-daemon>false</is-daemon>
  
            <max-threads>40</max-threads>
            <!-- these are ignored at the moment but will be fixed in later revisions -->
            <min-threads>20</min-threads>
            <min-spare-threads>20</min-spare-threads>
          </thread-group>
        </configuration>
  
      </component>
  
      <component>
        <role>org.apache.avalon.cornerstone.services.connection.ConnectionManager</role>
        <implementation>org.apache.avalon.cornerstone.blocks.connection.DefaultConnectionManager</implementation>
  
        <requirements>
          <requirement>
            <role>org.apache.avalon.cornerstone.services.threads.ThreadManager</role>
          </requirement>
        </requirements>
      </component>
  
      <component>
        <role>org.apache.avalon.cornerstone.services.sockets.SocketManager</role>
        <implementation>org.apache.avalon.cornerstone.blocks.sockets.DefaultSocketManager</implementation>
  
        <configuration>
          <server-sockets>
            <factory name="plain" class="org.apache.avalon.cornerstone.blocks.sockets.DefaultServerSocketFactory"
/>
          </server-sockets>
  
          <client-sockets>
            <factory name="plain" class="org.apache.avalon.cornerstone.blocks.sockets.DefaultSocketFactory"
/>
          </client-sockets>
        </configuration>
  
      </component>
  
      <component>
        <role>org.apache.ftpserver.usermanager.UserManagerInterface</role>
        <implementation>org.apache.ftpserver.usermanager.PropertiesUserManager</implementation>
        <configuration>
          <base-directory>${plexus.home}</base-directory>
        </configuration>
      </component>
      <component>
        <role>org.apache.ftpserver.ip.IpRestrictorInterface</role>
        <implementation>org.apache.ftpserver.ip.FileIpRestrictor</implementation>
        <configuration>
          <base-directory>${basedir}/target/local-repository</base-directory>
        </configuration>
      </component>
      <component>
        <role>org.apache.ftpserver.interfaces.FtpServerInterface</role>
        <implementation>org.apache.ftpserver.FtpServerImpl</implementation>
        <requirements>
          <requirement>
            <role>org.apache.avalon.cornerstone.services.sockets.SocketManager</role>
          </requirement>
          <requirement>
            <role>org.apache.avalon.cornerstone.services.connection.ConnectionManager</role>
          </requirement>
          <requirement>
            <role>org.apache.ftpserver.ip.IpRestrictorInterface</role>
          </requirement>
          <requirement>
            <role>org.apache.ftpserver.usermanager.UserManagerInterface</role>
          </requirement>
        </requirements>
        <configuration>
          <server-host>localhost</server-host>
          <self-host>localhost</self-host>
          <remote-admin-allowed>false</remote-admin-allowed>
  	    <ftp-port>10021</ftp-port>
          <default-user-root>${basedir}/target/local-repository</default-user-root>
        </configuration>
      </component>
    </components>
  </plexus>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: wagon-cvs-unsubscribe@maven.apache.org
For additional commands, e-mail: wagon-cvs-help@maven.apache.org


Mime
View raw message