maven-wagon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r658099 [1/2] - in /maven/wagon/trunk: wagon-provider-api/src/main/java/org/apache/maven/wagon/ wagon-provider-api/src/main/java/org/apache/maven/wagon/events/ wagon-provider-api/src/main/java/org/apache/maven/wagon/resource/ wagon-provider...
Date Tue, 20 May 2008 05:03:58 GMT
Author: brett
Date: Mon May 19 22:03:57 2008
New Revision: 658099

URL: http://svn.apache.org/viewvc?rev=658099&view=rev
Log:
[WAGON-109] Refactor Wagon HTTP and Wagon WebDav
Merged from: WAGON-109 branch r657713:658098

Added:
    maven/wagon/trunk/wagon-providers/wagon-http-shared/src/main/java/org/apache/maven/wagon/shared/http/AbstractHttpClientWagon.java
      - copied unchanged from r658098, maven/wagon/branches/WAGON-109/wagon-providers/wagon-http-shared/src/main/java/org/apache/maven/wagon/shared/http/AbstractHttpClientWagon.java
    maven/wagon/trunk/wagon-providers/wagon-http-shared/src/main/java/org/apache/maven/wagon/shared/http/PutInputStream.java
      - copied unchanged from r658098, maven/wagon/branches/WAGON-109/wagon-providers/wagon-http-shared/src/main/java/org/apache/maven/wagon/shared/http/PutInputStream.java
    maven/wagon/trunk/wagon-providers/wagon-http-shared/src/test/java/org/apache/maven/wagon/shared/http/PutInputStreamTest.java
      - copied unchanged from r658098, maven/wagon/branches/WAGON-109/wagon-providers/wagon-http-shared/src/test/java/org/apache/maven/wagon/shared/http/PutInputStreamTest.java
    maven/wagon/trunk/wagon-providers/wagon-webdav/src/main/java/org/apache/jackrabbit/
      - copied from r658098, maven/wagon/branches/WAGON-109/wagon-providers/wagon-webdav/src/main/java/org/apache/jackrabbit/
    maven/wagon/trunk/wagon-providers/wagon-webdav/src/main/java/org/apache/jackrabbit/webdav/
      - copied from r658098, maven/wagon/branches/WAGON-109/wagon-providers/wagon-webdav/src/main/java/org/apache/jackrabbit/webdav/
    maven/wagon/trunk/wagon-providers/wagon-webdav/src/main/java/org/apache/jackrabbit/webdav/WebdavResponseImpl.java
      - copied unchanged from r658098, maven/wagon/branches/WAGON-109/wagon-providers/wagon-webdav/src/main/java/org/apache/jackrabbit/webdav/WebdavResponseImpl.java
    maven/wagon/trunk/wagon-providers/wagon-webdav/src/main/java/org/apache/jackrabbit/webdav/client/
      - copied from r658098, maven/wagon/branches/WAGON-109/wagon-providers/wagon-webdav/src/main/java/org/apache/jackrabbit/webdav/client/
    maven/wagon/trunk/wagon-providers/wagon-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/
      - copied from r658098, maven/wagon/branches/WAGON-109/wagon-providers/wagon-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/
    maven/wagon/trunk/wagon-providers/wagon-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/XmlRequestEntity.java
      - copied unchanged from r658098, maven/wagon/branches/WAGON-109/wagon-providers/wagon-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/XmlRequestEntity.java
    maven/wagon/trunk/wagon-providers/wagon-webdav/src/main/java/org/apache/maven/wagon/providers/webdav/PathNavigator.java
      - copied unchanged from r658098, maven/wagon/branches/WAGON-109/wagon-providers/wagon-webdav/src/main/java/org/apache/maven/wagon/providers/webdav/PathNavigator.java
    maven/wagon/trunk/wagon-providers/wagon-webdav/src/test/java/org/apache/maven/wagon/providers/webdav/PathNavigatorTest.java
      - copied unchanged from r658098, maven/wagon/branches/WAGON-109/wagon-providers/wagon-webdav/src/test/java/org/apache/maven/wagon/providers/webdav/PathNavigatorTest.java
Removed:
    maven/wagon/trunk/wagon-providers/wagon-webdav/src/main/java/org/apache/maven/wagon/providers/webdav/CorrectedWebdavResource.java
    maven/wagon/trunk/wagon-providers/wagon-webdav/src/main/java/org/apache/maven/wagon/providers/webdav/PutInputStream.java
    maven/wagon/trunk/wagon-providers/wagon-webdav/src/main/resources/
    maven/wagon/trunk/wagon-providers/wagon-webdav/src/test/java/org/apache/maven/wagon/providers/webdav/PutInputStreamTest.java
Modified:
    maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/AbstractWagon.java
    maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/SessionEvent.java
    maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/TransferEvent.java
    maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/WagonEvent.java
    maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/resource/Resource.java
    maven/wagon/trunk/wagon-provider-test/pom.xml
    maven/wagon/trunk/wagon-provider-test/src/main/java/org/apache/maven/wagon/WagonTestCase.java
    maven/wagon/trunk/wagon-providers/wagon-ftp/src/test/java/org/apache/maven/wagon/providers/ftp/FtpWagonTest.java
    maven/wagon/trunk/wagon-providers/wagon-http-lightweight/pom.xml
    maven/wagon/trunk/wagon-providers/wagon-http-shared/pom.xml
    maven/wagon/trunk/wagon-providers/wagon-http/pom.xml
    maven/wagon/trunk/wagon-providers/wagon-http/src/main/java/org/apache/maven/wagon/providers/http/HttpWagon.java
    maven/wagon/trunk/wagon-providers/wagon-http/src/main/resources/META-INF/plexus/components.xml
    maven/wagon/trunk/wagon-providers/wagon-scm/src/main/java/org/apache/maven/wagon/providers/scm/ScmWagon.java
    maven/wagon/trunk/wagon-providers/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/AbstractScmCvsWagonTest.java
    maven/wagon/trunk/wagon-providers/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/AbstractScmSvnWagonTest.java
    maven/wagon/trunk/wagon-providers/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/AbstractScmWagonTest.java
    maven/wagon/trunk/wagon-providers/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/ScmCvsExeWagonTest.java
    maven/wagon/trunk/wagon-providers/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/ScmSvnExeWagonTest.java
    maven/wagon/trunk/wagon-providers/wagon-webdav/pom.xml
    maven/wagon/trunk/wagon-providers/wagon-webdav/src/main/java/org/apache/maven/wagon/providers/webdav/WebDavWagon.java
    maven/wagon/trunk/wagon-providers/wagon-webdav/src/test/java/org/apache/maven/wagon/providers/webdav/WebDavWagonGzipTest.java
    maven/wagon/trunk/wagon-providers/wagon-webdav/src/test/java/org/apache/maven/wagon/providers/webdav/WebDavWagonTest.java

Modified: maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/AbstractWagon.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/AbstractWagon.java?rev=658099&r1=658098&r2=658099&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/AbstractWagon.java (original)
+++ maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/AbstractWagon.java Mon May 19 22:03:57 2008
@@ -257,6 +257,10 @@
     protected void putTransfer( Resource resource, File source, OutputStream output, boolean closeOutput )
         throws TransferFailedException
     {
+        resource.setContentLength( source.length() );
+
+        resource.setLastModified( source.lastModified() );
+
         firePutStarted( resource, source );
 
         transfer( resource, source, output, closeOutput );
@@ -278,10 +282,6 @@
     protected void transfer( Resource resource, File source, OutputStream output, boolean closeOutput )
         throws TransferFailedException
     {
-        resource.setContentLength( source.length() );
-
-        resource.setLastModified( source.lastModified() );
-
         InputStream input = null;
 
         try
@@ -346,6 +346,7 @@
         byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
 
         TransferEvent transferEvent = new TransferEvent( this, resource, TransferEvent.TRANSFER_PROGRESS, requestType );
+        transferEvent.setTimestamp( System.currentTimeMillis() );
 
         int remaining = maxSize;
         while ( remaining > 0 )
@@ -626,6 +627,8 @@
         byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
 
         TransferEvent transferEvent = new TransferEvent( this, resource, TransferEvent.TRANSFER_PROGRESS, requestType );
+        transferEvent.setTimestamp( System.currentTimeMillis() );
+        transferEvent.setLocalFile( source );
 
         try
         {

Modified: maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/SessionEvent.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/SessionEvent.java?rev=658099&r1=658098&r2=658099&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/SessionEvent.java (original)
+++ maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/SessionEvent.java Mon May 19 22:03:57 2008
@@ -218,7 +218,7 @@
         }
         sb.append( "|" );
 
-        sb.append( this.repository ).append( "|" );
+        sb.append( this.getWagon().getRepository() ).append( "|" );
         sb.append( this.source );
 
         if ( exception != null )

Modified: maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/TransferEvent.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/TransferEvent.java?rev=658099&r1=658098&r2=658099&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/TransferEvent.java (original)
+++ maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/TransferEvent.java Mon May 19 22:03:57 2008
@@ -252,11 +252,56 @@
 
         sb.append( "|" );
 
-        sb.append( this.repository ).append( "|" );
+        sb.append( this.getWagon().getRepository() ).append( "|" );
         sb.append( this.getLocalFile() ).append( "|" );
         sb.append( this.getResource() );
         sb.append( "]" );
 
         return sb.toString();
     }
+
+    public int hashCode()
+    {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + eventType;
+        result = prime * result + ( ( exception == null ) ? 0 : exception.hashCode() );
+        result = prime * result + ( ( localFile == null ) ? 0 : localFile.hashCode() );
+        result = prime * result + requestType;
+        result = prime * result + ( ( resource == null ) ? 0 : resource.hashCode() );
+        return result;
+    }
+
+    public boolean equals( Object obj )
+    {
+        if ( this == obj )
+            return true;
+        if ( obj == null )
+            return false;
+        if ( getClass() != obj.getClass() )
+            return false;
+        final TransferEvent other = (TransferEvent) obj;
+        if ( eventType != other.eventType )
+            return false;
+        if ( exception == null )
+        {
+            if ( other.exception != null )
+                return false;
+        }
+        else if ( !exception.equals( other.exception ) )
+            return false;
+        if ( requestType != other.requestType )
+            return false;
+        if ( resource == null )
+        {
+            if ( other.resource != null )
+                return false;
+        }
+        else if ( !resource.equals( other.resource ) )
+            return false;
+        else if ( !source.equals( other.source ) )
+            return false;
+        return true;
+    }
+    
 }

Modified: maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/WagonEvent.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/WagonEvent.java?rev=658099&r1=658098&r2=658099&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/WagonEvent.java (original)
+++ maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/WagonEvent.java Mon May 19 22:03:57 2008
@@ -34,12 +34,6 @@
     extends EventObject
 {
     /**
-     * Repository to which the Wagon
-     * object which emitted this event is connected
-     */
-    protected Repository repository;
-
-    /**
      * The time when event occured
      */
     protected long timestamp;

Modified: maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/resource/Resource.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/resource/Resource.java?rev=658099&r1=658098&r2=658099&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/resource/Resource.java (original)
+++ maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/resource/Resource.java Mon May 19 22:03:57 2008
@@ -91,4 +91,37 @@
     {
         return name;
     }
+
+    public int hashCode()
+    {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + (int) ( contentLength ^ ( contentLength >>> 32 ) );
+        result = prime * result + (int) ( lastModified ^ ( lastModified >>> 32 ) );
+        result = prime * result + ( ( name == null ) ? 0 : name.hashCode() );
+        return result;
+    }
+
+    public boolean equals( Object obj )
+    {
+        if ( this == obj )
+            return true;
+        if ( obj == null )
+            return false;
+        if ( getClass() != obj.getClass() )
+            return false;
+        final Resource other = (Resource) obj;
+        if ( contentLength != other.contentLength )
+            return false;
+        if ( lastModified != other.lastModified )
+            return false;
+        if ( name == null )
+        {
+            if ( other.name != null )
+                return false;
+        }
+        else if ( !name.equals( other.name ) )
+            return false;
+        return true;
+    }
 }

Modified: maven/wagon/trunk/wagon-provider-test/pom.xml
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-provider-test/pom.xml?rev=658099&r1=658098&r2=658099&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-provider-test/pom.xml (original)
+++ maven/wagon/trunk/wagon-provider-test/pom.xml Mon May 19 22:03:57 2008
@@ -45,5 +45,10 @@
       <artifactId>plexus-container-default</artifactId>
       <scope>compile</scope>
     </dependency>
+    <dependency>
+      <groupId>easymock</groupId>
+      <artifactId>easymock</artifactId>
+      <version>1.2_Java1.3</version>
+    </dependency>
   </dependencies>
 </project>

Modified: maven/wagon/trunk/wagon-provider-test/src/main/java/org/apache/maven/wagon/WagonTestCase.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-provider-test/src/main/java/org/apache/maven/wagon/WagonTestCase.java?rev=658099&r1=658098&r2=658099&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-provider-test/src/main/java/org/apache/maven/wagon/WagonTestCase.java (original)
+++ maven/wagon/trunk/wagon-provider-test/src/main/java/org/apache/maven/wagon/WagonTestCase.java Mon May 19 22:03:57 2008
@@ -21,12 +21,18 @@
 
 import org.apache.maven.wagon.authentication.AuthenticationInfo;
 import org.apache.maven.wagon.authorization.AuthorizationException;
+import org.apache.maven.wagon.events.TransferEvent;
+import org.apache.maven.wagon.events.TransferListener;
 import org.apache.maven.wagon.observers.ChecksumObserver;
 import org.apache.maven.wagon.observers.Debug;
 import org.apache.maven.wagon.repository.Repository;
 import org.apache.maven.wagon.repository.RepositoryPermissions;
+import org.apache.maven.wagon.resource.Resource;
 import org.codehaus.plexus.PlexusTestCase;
 import org.codehaus.plexus.util.FileUtils;
+import org.easymock.AbstractMatcher;
+import org.easymock.ArgumentsMatcher;
+import org.easymock.MockControl;
 
 import java.io.File;
 import java.io.IOException;
@@ -41,6 +47,31 @@
 public abstract class WagonTestCase
     extends PlexusTestCase
 {
+    private static final class ProgressArgumentMatcher
+        extends AbstractMatcher
+    {
+        private int size;
+
+        protected boolean argumentMatches( Object expected, Object actual )
+        {
+            if ( actual instanceof byte[] )
+            {
+                return true;
+            }
+            if ( actual instanceof Integer )
+            {
+                size += ((Integer) actual).intValue();
+                return true;
+            }
+            return super.argumentMatches( expected, actual );
+        }
+        
+        public int getSize()
+        {
+            return size;
+        }
+    }
+
     protected static String POM = "pom.xml";
 
     protected Repository localRepository;
@@ -60,6 +91,10 @@
     protected File artifactDestFile;
 
     protected ChecksumObserver checksumObserver;
+    
+    protected TransferListener mockTransferListener;
+    
+    protected MockControl mockTransferListenerControl;
 
     // ----------------------------------------------------------------------
     // Constructors
@@ -69,6 +104,9 @@
         throws Exception
     {
         checksumObserver = new ChecksumObserver();
+        
+        mockTransferListenerControl = MockControl.createControl( TransferListener.class ); 
+        mockTransferListener = (TransferListener) mockTransferListenerControl.getMock();
 
         super.setUp();
     }
@@ -593,51 +631,135 @@
     protected void putFile( String resourceName, String testFileName, String content )
         throws Exception
     {
-        message( "Putting test artifact: " + resourceName + " into test repository " + testRepository );
+        sourceFile = new File( FileTestUtils.getTestOutputDir(), testFileName );
+        sourceFile.getParentFile().mkdirs();
+        FileUtils.fileWrite( sourceFile.getAbsolutePath(), content );
 
         Wagon wagon = getWagon();
 
+        Resource resource = new Resource( resourceName );
+        mockTransferListener.transferInitiated( createTransferEvent( wagon, resource, TransferEvent.TRANSFER_INITIATED,
+                                                                     TransferEvent.REQUEST_PUT, sourceFile ) );
+        resource = new Resource( resourceName );
+        resource.setContentLength( content.length() );
+        resource.setLastModified( sourceFile.lastModified() );
+        mockTransferListener.transferStarted( createTransferEvent( wagon, resource, TransferEvent.TRANSFER_STARTED,
+                                                                   TransferEvent.REQUEST_PUT, sourceFile ) );
+        mockTransferListener.transferProgress( createTransferEvent( wagon, resource, TransferEvent.TRANSFER_PROGRESS,
+                                                                    TransferEvent.REQUEST_PUT, sourceFile ),
+                                               new byte[] {}, 0 );
+        ProgressArgumentMatcher progressArgumentMatcher = new ProgressArgumentMatcher();
+        mockTransferListenerControl.setMatcher( progressArgumentMatcher );
+
+        mockTransferListener.debug( null );
+        mockTransferListenerControl.setMatcher( MockControl.ALWAYS_MATCHER );
+        mockTransferListenerControl.setVoidCallable( MockControl.ZERO_OR_MORE );
+        
+        mockTransferListener.transferCompleted( createTransferEvent( wagon, resource, TransferEvent.TRANSFER_COMPLETED,
+                                                                     TransferEvent.REQUEST_PUT, sourceFile ) );
+        
+        mockTransferListenerControl.replay();
+        
+        message( "Putting test artifact: " + resourceName + " into test repository " + testRepository );
+
         wagon.addTransferListener( checksumObserver );
 
-        wagon.connect( testRepository, getAuthInfo() );
+        wagon.addTransferListener( mockTransferListener );
 
-        sourceFile = new File( FileTestUtils.getTestOutputDir(), testFileName );
-        sourceFile.getParentFile().mkdirs();
-        FileUtils.fileWrite( sourceFile.getAbsolutePath(), content );
+        wagon.connect( testRepository, getAuthInfo() );
 
         wagon.put( sourceFile, resourceName );
 
+        wagon.removeTransferListener( mockTransferListener );
+        
         wagon.removeTransferListener( checksumObserver );
 
         wagon.disconnect();
+        
+        mockTransferListenerControl.verify();
+        
+        assertEquals( content.length(), progressArgumentMatcher.getSize() );
+        
+        mockTransferListenerControl.reset();
+    }
+
+    private TransferEvent createTransferEvent( Wagon wagon, Resource resource, int eventType, int requestType,
+                                               File file )
+    {
+        TransferEvent transferEvent = new TransferEvent( wagon, resource, eventType, requestType );
+        transferEvent.setLocalFile( file );
+        return transferEvent;
     }
 
-    protected void putFile()
+    protected int putFile()
         throws Exception
     {
-        putFile( resource, "test-resource", "test-resource.txt\n" );
+        String content = "test-resource.txt\n";
+        putFile( resource, "test-resource", content );
+        return content.length();
     }
 
-    protected void getFile()
+    protected void getFile(int expectedSize)
         throws Exception
     {
-        message( "Getting test artifact from test repository " + testRepository );
+        destFile = FileTestUtils.createUniqueFile( getName(), getName() );
+        destFile.deleteOnExit();
 
         Wagon wagon = getWagon();
 
+        Resource resource = new Resource( this.resource );
+        mockTransferListener.transferInitiated( createTransferEvent( wagon, resource, TransferEvent.TRANSFER_INITIATED,
+                                                                     TransferEvent.REQUEST_GET, destFile ) );
+        resource = new Resource( this.resource );
+        resource.setContentLength( getExpectedContentLengthOnGet( expectedSize ) );
+        resource.setLastModified( getExpectedLastModifiedOnGet() );
+        mockTransferListener.transferStarted( createTransferEvent( wagon, resource, TransferEvent.TRANSFER_STARTED,
+                                                                   TransferEvent.REQUEST_GET, destFile ) );
+        mockTransferListener.transferProgress( new TransferEvent( wagon, resource, TransferEvent.TRANSFER_PROGRESS,
+                                                                  TransferEvent.REQUEST_GET ), new byte[] {}, 0 );
+        ProgressArgumentMatcher progressArgumentMatcher = new ProgressArgumentMatcher();
+        mockTransferListenerControl.setMatcher( progressArgumentMatcher );
+        
+        mockTransferListener.debug( null );
+        mockTransferListenerControl.setMatcher( MockControl.ALWAYS_MATCHER );
+        mockTransferListenerControl.setVoidCallable( MockControl.ZERO_OR_MORE );
+        
+        mockTransferListener.transferCompleted( createTransferEvent( wagon, resource, TransferEvent.TRANSFER_COMPLETED,
+                                                                     TransferEvent.REQUEST_GET, destFile ) );
+        
+        mockTransferListenerControl.replay();
+        
+        message( "Getting test artifact from test repository " + testRepository );
+
         wagon.addTransferListener( checksumObserver );
+        
+        wagon.addTransferListener( mockTransferListener );
 
         wagon.connect( testRepository, getAuthInfo() );
 
-        destFile = FileTestUtils.createUniqueFile( getName(), getName() );
-
-        destFile.deleteOnExit();
-
-        wagon.get( resource, destFile );
+        wagon.get( this.resource, destFile );
 
+        wagon.removeTransferListener( mockTransferListener );
+        
         wagon.removeTransferListener( checksumObserver );
 
         wagon.disconnect();
+        
+        mockTransferListenerControl.verify();
+        
+        assertEquals( expectedSize, progressArgumentMatcher.getSize() );
+        
+        mockTransferListenerControl.reset();
+    }
+
+    protected int getExpectedContentLengthOnGet( int expectedSize )
+    {
+        return expectedSize;
+    }
+
+    protected long getExpectedLastModifiedOnGet()
+    {
+        return sourceFile.lastModified();
     }
 
     protected void fileRoundTripTesting()
@@ -645,7 +767,7 @@
     {
         message( "File round trip testing ..." );
 
-        putFile();
+        int expectedSize = putFile();
 
         assertNotNull( "check checksum is not null", checksumObserver.getActualChecksum() );
 
@@ -653,7 +775,7 @@
 
         checksumObserver = new ChecksumObserver();
 
-        getFile();
+        getFile( expectedSize );
 
         assertNotNull( "check checksum is not null", checksumObserver.getActualChecksum() );
 

Modified: maven/wagon/trunk/wagon-providers/wagon-ftp/src/test/java/org/apache/maven/wagon/providers/ftp/FtpWagonTest.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-ftp/src/test/java/org/apache/maven/wagon/providers/ftp/FtpWagonTest.java?rev=658099&r1=658098&r2=658099&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-ftp/src/test/java/org/apache/maven/wagon/providers/ftp/FtpWagonTest.java (original)
+++ maven/wagon/trunk/wagon-providers/wagon-ftp/src/test/java/org/apache/maven/wagon/providers/ftp/FtpWagonTest.java Mon May 19 22:03:57 2008
@@ -37,6 +37,12 @@
         return "ftp";
     }
 
+    protected long getExpectedLastModifiedOnGet()
+    {
+        // granularity for FTP is minutes
+        return ( sourceFile.lastModified() / 60000 ) * 60000;
+    }
+
     protected void setupWagonTestingFixtures()
         throws Exception
     {

Modified: maven/wagon/trunk/wagon-providers/wagon-http-lightweight/pom.xml
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-http-lightweight/pom.xml?rev=658099&r1=658098&r2=658099&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-http-lightweight/pom.xml (original)
+++ maven/wagon/trunk/wagon-providers/wagon-http-lightweight/pom.xml Mon May 19 22:03:57 2008
@@ -40,6 +40,12 @@
       <groupId>${pom.groupId}</groupId>
       <artifactId>wagon-http-shared</artifactId>
       <version>${pom.version}</version>
+      <exclusions>
+        <exclusion>
+          <groupId>commons-httpclient</groupId>
+          <artifactId>commons-httpclient</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
     <dependency>
       <groupId>plexus</groupId>

Modified: maven/wagon/trunk/wagon-providers/wagon-http-shared/pom.xml
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-http-shared/pom.xml?rev=658099&r1=658098&r2=658099&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-http-shared/pom.xml (original)
+++ maven/wagon/trunk/wagon-providers/wagon-http-shared/pom.xml Mon May 19 22:03:57 2008
@@ -17,7 +17,7 @@
   ~ 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"
@@ -31,19 +31,20 @@
   <artifactId>wagon-http-shared</artifactId>
   <name>Maven Wagon HTTP Shared Library</name>
   <description>
-    Shared Library for the wagon-http, and wagon-http-lightweight wagon providers.
+    Shared Library for the wagon-http, and wagon-http-lightweight wagon
+    providers.
   </description>
 
-  <issueManagement>
-    <system>jira</system>
-    <url>http://jira.codehaus.org/browse/WAGONHTTP</url>
-  </issueManagement>
-
   <dependencies>
     <dependency>
       <groupId>jtidy</groupId>
       <artifactId>jtidy</artifactId>
       <version>4aug2000r7-dev</version>
     </dependency>
+    <dependency>
+      <groupId>commons-httpclient</groupId>
+      <artifactId>commons-httpclient</artifactId>
+      <version>3.1</version>
+    </dependency>
   </dependencies>
 </project>

Modified: maven/wagon/trunk/wagon-providers/wagon-http/pom.xml
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-http/pom.xml?rev=658099&r1=658098&r2=658099&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-http/pom.xml (original)
+++ maven/wagon/trunk/wagon-providers/wagon-http/pom.xml Mon May 19 22:03:57 2008
@@ -53,17 +53,19 @@
       </exclusions>
     </dependency>
     <dependency>
-      <groupId>commons-logging</groupId>
-      <artifactId>commons-logging</artifactId>
-      <version>1.0.4</version>
-      <scope>runtime</scope>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <version>2.3</version>
+      <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>commons-httpclient</groupId>
-      <artifactId>commons-httpclient</artifactId>
-      <version>3.1</version>
+      <groupId>org.mortbay.jetty</groupId>
+      <artifactId>jetty</artifactId>
+      <version>4.2.12</version>
+      <scope>test</scope>
     </dependency>
   </dependencies>
+    <!-- I believe we can shade this in Maven itself
   <build>
     <plugins>
       <plugin>
@@ -106,4 +108,5 @@
       </plugin>
     </plugins>
   </build>
+    -->
 </project>

Modified: maven/wagon/trunk/wagon-providers/wagon-http/src/main/java/org/apache/maven/wagon/providers/http/HttpWagon.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-http/src/main/java/org/apache/maven/wagon/providers/http/HttpWagon.java?rev=658099&r1=658098&r2=658099&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-http/src/main/java/org/apache/maven/wagon/providers/http/HttpWagon.java (original)
+++ maven/wagon/trunk/wagon-providers/wagon-http/src/main/java/org/apache/maven/wagon/providers/http/HttpWagon.java Mon May 19 22:03:57 2008
@@ -19,372 +19,25 @@
  * under the License.
  */
 
-import java.io.File;
-import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
-import java.text.SimpleDateFormat;
-import java.util.Date;
 import java.util.List;
-import java.util.Locale;
-import java.util.TimeZone;
-import java.util.zip.GZIPInputStream;
-
-import org.apache.commons.httpclient.Credentials;
-import org.apache.commons.httpclient.Header;
-import org.apache.commons.httpclient.HostConfiguration;
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.HttpConnectionManager;
-import org.apache.commons.httpclient.HttpMethod;
+
 import org.apache.commons.httpclient.HttpStatus;
-import org.apache.commons.httpclient.NTCredentials;
-import org.apache.commons.httpclient.UsernamePasswordCredentials;
 import org.apache.commons.httpclient.methods.GetMethod;
-import org.apache.commons.httpclient.methods.HeadMethod;
-import org.apache.commons.httpclient.methods.PutMethod;
-import org.apache.commons.httpclient.util.DateParseException;
-import org.apache.commons.httpclient.util.DateParser;
-import org.apache.maven.wagon.AbstractWagon;
 import org.apache.maven.wagon.ResourceDoesNotExistException;
 import org.apache.maven.wagon.TransferFailedException;
 import org.apache.maven.wagon.authorization.AuthorizationException;
-import org.apache.maven.wagon.events.TransferEvent;
-import org.apache.maven.wagon.resource.Resource;
+import org.apache.maven.wagon.shared.http.AbstractHttpClientWagon;
 import org.apache.maven.wagon.shared.http.HtmlFileListParser;
-import org.codehaus.plexus.util.IOUtil;
-import org.codehaus.plexus.util.StringUtils;
 
 /**
  * @author <a href="michal.maczka@dimatics.com">Michal Maczka</a>
  * @version $Id$
  */
 public class HttpWagon
-    extends AbstractWagon
-{
-    private static final int SC_NULL = -1;
-
-    private HttpClient client;
-
-    private static final TimeZone GMT_TIME_ZONE = TimeZone.getTimeZone( "GMT" );
-
-    private HttpConnectionManager connectionManager;
-
-    protected void openConnectionInternal()
-    {
-        client = new HttpClient( connectionManager );
-
-        String username = null;
-
-        String password = null;
-
-        if ( authenticationInfo != null )
-        {
-            username = authenticationInfo.getUserName();
-
-            password = authenticationInfo.getPassword();
-        }
-
-        String host = getRepository().getHost();
-
-        if ( StringUtils.isNotEmpty( username ) && StringUtils.isNotEmpty( password ) )
-        {
-            Credentials creds = new UsernamePasswordCredentials( username, password );
-
-            client.getState().setCredentials( null, host, creds );
-            client.getState().setAuthenticationPreemptive( true );
-        }
-
-        HostConfiguration hc = new HostConfiguration();
-
-        if ( proxyInfo != null )
-        {
-            String proxyUsername = proxyInfo.getUserName();
-
-            String proxyPassword = proxyInfo.getPassword();
-
-            String proxyHost = proxyInfo.getHost();
-
-            int proxyPort = proxyInfo.getPort();
-
-            String proxyNtlmHost = proxyInfo.getNtlmHost();
-
-            String proxyNtlmDomain = proxyInfo.getNtlmDomain();
-
-            if ( proxyHost != null )
-            {
-                hc.setProxy( proxyHost, proxyPort );
-
-                if ( proxyUsername != null && proxyPassword != null )
-                {
-                    Credentials creds;
-                    if ( proxyNtlmHost != null || proxyNtlmDomain != null )
-                    {
-                        creds = new NTCredentials( proxyUsername, proxyPassword, proxyNtlmHost, proxyNtlmDomain );
-                    }
-                    else
-                    {
-                        creds = new UsernamePasswordCredentials( proxyUsername, proxyPassword );
-                    }
-
-                    client.getState().setProxyCredentials( null, proxyHost, creds );
-                    client.getState().setAuthenticationPreemptive( true );
-                }
-            }
-        }
-
-        hc.setHost( host );
-
-        //start a session with the webserver
-        client.setHostConfiguration( hc );
-    }
-
-    // put
-    public void put( File source, String resourceName )
-        throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
-    {
-        String url = getRepository().getUrl() + "/" + resourceName;
-
-        Resource resource = new Resource( resourceName );
-
-        firePutInitiated( resource, source );
-
-        PutMethod putMethod = new PutMethod( url );
-        putMethod.getParams().setSoTimeout( getTimeout() );
-
-        try
-        {
-            InputStream is = new PutInputStream( source, resource, this, getTransferEventSupport() );
-            putMethod.setRequestBody( is );
-        }
-        catch ( FileNotFoundException e )
-        {
-            fireTransferError( resource, e, TransferEvent.REQUEST_PUT );
-
-            throw new ResourceDoesNotExistException( "Source file does not exist: " + source, e );
-        }
-
-        int statusCode = execute( putMethod );
-        
-        fireTransferDebug( url + " - Status code: " + statusCode );
-
-        // Check that we didn't run out of retries.
-        switch ( statusCode )
-        {
-            // Success Codes
-            case HttpStatus.SC_OK: // 200
-            case HttpStatus.SC_CREATED: // 201
-            case HttpStatus.SC_ACCEPTED: // 202
-            case HttpStatus.SC_NO_CONTENT:  // 204
-                break;
-
-            case SC_NULL:
-                throw new TransferFailedException( "Failed to transfer file: " + url );
-
-            case HttpStatus.SC_FORBIDDEN:
-                throw new AuthorizationException( "Access denied to: " + url );
-
-            case HttpStatus.SC_NOT_FOUND:
-                throw new ResourceDoesNotExistException( "File: " + url + " does not exist" );
-
-                //add more entries here
-            default :
-                throw new TransferFailedException(
-                    "Failed to transfer file: " + url + ". Return code is: " + statusCode );
-        }
-
-        putMethod.releaseConnection();
-
-        firePutCompleted( resource, source );
-    }
-
-    public void closeConnection()
-    {
-    }
-
-    public void get( String resourceName, File destination )
-        throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
-    {
-        get( resourceName, destination, 0 );
-    }
-
-    public boolean getIfNewer( String resourceName, File destination, long timestamp )
-        throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
-    {
-        return get( resourceName, destination, timestamp );
-    }
-
-    /**
-     * @param resourceName
-     * @param destination
-     * @param timestamp the timestamp to check against, only downloading if newer. If <code>0</code>, always download
-     * @return <code>true</code> if newer version was downloaded, <code>false</code> otherwise.
-     * @throws TransferFailedException
-     * @throws ResourceDoesNotExistException
-     * @throws AuthorizationException
-     */
-    public boolean get( String resourceName, File destination, long timestamp )
-        throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
-    {
-        Resource resource = new Resource( resourceName );
-
-        fireGetInitiated( resource, destination );
-
-        boolean retValue = false;
-
-        String url = getRepository().getUrl() + "/" + resourceName;
-
-        GetMethod getMethod = new GetMethod( url );
-        getMethod.getParams().setSoTimeout( getTimeout() );
-
-        try
-        {
-            // TODO: make these configurable
-
-            getMethod.addRequestHeader( "Cache-control", "no-cache" );
-            getMethod.addRequestHeader( "Cache-store", "no-store" );
-            getMethod.addRequestHeader( "Pragma", "no-cache" );
-            getMethod.addRequestHeader( "Expires", "0" );
-            getMethod.addRequestHeader( "Accept-Encoding", "gzip" );
-
-            if ( timestamp > 0 )
-            {
-                SimpleDateFormat fmt = new SimpleDateFormat( "EEE, dd-MMM-yy HH:mm:ss zzz", Locale.US );
-                fmt.setTimeZone( GMT_TIME_ZONE );
-                Header hdr = new Header( "If-Modified-Since", fmt.format( new Date( timestamp ) ) );
-                fireTransferDebug( "sending ==> " + hdr + "(" + timestamp + ")" );
-                getMethod.addRequestHeader( hdr );
-            }
-
-            int statusCode = execute( getMethod );
-
-            fireTransferDebug( url + " - Status code: " + statusCode );
-
-            // TODO [BP]: according to httpclient docs, really should swallow the output on error. verify if that is required
-            switch ( statusCode )
-            {
-                case HttpStatus.SC_OK:
-                    break;
-
-                case HttpStatus.SC_NOT_MODIFIED:
-                    return false;
-
-                case SC_NULL:
-                    throw new TransferFailedException( "Failed to transfer file: " + url );
-
-                case HttpStatus.SC_FORBIDDEN:
-                    throw new AuthorizationException( "Access denied to: " + url );
-
-                case HttpStatus.SC_UNAUTHORIZED:
-                    throw new AuthorizationException( "Not authorized." );
-
-                case HttpStatus.SC_PROXY_AUTHENTICATION_REQUIRED:
-                    throw new AuthorizationException( "Not authorized by proxy." );
-
-                case HttpStatus.SC_NOT_FOUND:
-                    throw new ResourceDoesNotExistException( "File: " + url + " does not exist" );
-
-                    //add more entries here
-                default :
-                    throw new TransferFailedException(
-                        "Failed to transfer file: " + url + ". Return code is: " + statusCode );
-            }
-
-            InputStream is = null;
-
-            Header contentLengthHeader = getMethod.getResponseHeader( "Content-Length" );
-
-            if ( contentLengthHeader != null )
-            {
-                try
-                {
-                    long contentLength = Integer.valueOf( contentLengthHeader.getValue() ).intValue();
-
-                    resource.setContentLength( contentLength );
-                }
-                catch ( NumberFormatException e )
-                {
-                    fireTransferDebug(
-                        "error parsing content length header '" + contentLengthHeader.getValue() + "' " + e );
-                }
-            }
-
-            Header lastModifiedHeader = getMethod.getResponseHeader( "Last-Modified" );
-
-            long lastModified = 0;
-
-            if ( lastModifiedHeader != null )
-            {
-                try
-                {
-                    lastModified = DateParser.parseDate( lastModifiedHeader.getValue() ).getTime();
-                }
-                catch ( DateParseException e )
-                {
-                    fireTransferDebug( "Unable to parse last modified header" );
-                }
-
-                fireTransferDebug( "last-modified = " + lastModifiedHeader.getValue() + " (" + lastModified + ")" );
-            }
-
-            // always get if timestamp is 0 (ie, target doesn't exist), otherwise only if older than the remote file
-            if ( timestamp == 0 || timestamp < lastModified )
-            {
-                retValue = true;
-                
-                Header contentEncoding = getMethod.getResponseHeader( "Content-Encoding" );
-                boolean isGZipped = contentEncoding == null ? false : "gzip".equalsIgnoreCase(contentEncoding.getValue());
-
-                try
-                {
-                    is = getMethod.getResponseBodyAsStream();
-                    if (isGZipped)
-                    {
-                        is = new GZIPInputStream( is );
-                    }
-
-                    getTransfer( resource, destination, is );
-                }
-                catch ( IOException e )
-                {
-                    fireTransferError( resource, e, TransferEvent.REQUEST_GET );
-
-                    if ( destination.exists() )
-                    {
-                        boolean deleted = destination.delete();
-
-                        if ( !deleted )
-                        {
-                            destination.deleteOnExit();
-                        }
-                    }
-
-                    String msg = "Error occurred while deploying to remote repository:" + getRepository();
-
-                    throw new TransferFailedException( msg, e );
-                }
-                finally
-                {
-                    IOUtil.close( is );
-                }
-
-                if ( lastModified > 0 )
-                {
-                    resource.setLastModified( lastModified );
-                }
-            }
-            else
-            {
-                fireTransferDebug( "Local file is newer: not downloaded" );
-            }
-
-            return retValue;
-        }
-        finally
-        {
-            getMethod.releaseConnection();
-        }
-    }
-
+    extends AbstractHttpClientWagon
+{ 
     public List getFileList( String destinationDirectory )
         throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException 
     {
@@ -396,17 +49,9 @@
         String url = getRepository().getUrl() + "/" + destinationDirectory;
 
         GetMethod getMethod = new GetMethod( url );
-        getMethod.getParams().setSoTimeout( getTimeout() );
 
         try
         {
-            // TODO: make these configurable
-
-            getMethod.addRequestHeader( "Cache-control", "no-cache" );
-            getMethod.addRequestHeader( "Cache-store", "no-store" );
-            getMethod.addRequestHeader( "Pragma", "no-cache" );
-            getMethod.addRequestHeader( "Expires", "0" );
-
             int statusCode = execute( getMethod );
 
             fireTransferDebug( url + " - Status code: " + statusCode );
@@ -453,71 +98,4 @@
             getMethod.releaseConnection();
         }
     }
-
-    public boolean resourceExists( String resourceName )
-        throws TransferFailedException, AuthorizationException
-    {
-        String url = getRepository().getUrl() + "/" + resourceName;
-        
-        HeadMethod headMethod = new HeadMethod( url );
-        headMethod.getParams().setSoTimeout( getTimeout() );
-        
-        int statusCode = execute( headMethod );
-        
-        try
-        {
-            switch ( statusCode )
-            {
-                case HttpStatus.SC_OK:
-                    return true;
-
-                case HttpStatus.SC_NOT_MODIFIED:
-                    return true;
-
-                case SC_NULL:
-                    throw new TransferFailedException( "Failed to transfer file: " + url);
-
-                case HttpStatus.SC_FORBIDDEN:
-                    throw new AuthorizationException( "Access denied to: " + url );
-
-                case HttpStatus.SC_UNAUTHORIZED:
-                    throw new AuthorizationException( "Not authorized." );
-
-                case HttpStatus.SC_PROXY_AUTHENTICATION_REQUIRED:
-                    throw new AuthorizationException( "Not authorized by proxy." );
-
-                case HttpStatus.SC_NOT_FOUND:
-                    return false;
-
-                    //add more entries here
-                default:
-                    throw new TransferFailedException( "Failed to transfer file: " + url + ". Return code is: "
-                        + statusCode );
-            }
-        }
-        finally
-        {
-            headMethod.releaseConnection();
-        }
-    }
-
-    private int execute(HttpMethod httpMethod)
-        throws TransferFailedException
-    {
-        int statusCode = SC_NULL;
-        try
-        {
-            // execute the method.
-            statusCode = client.executeMethod( httpMethod );
-        }
-        catch ( IOException e )
-        {
-            throw new TransferFailedException( e.getMessage(), e );
-        }
-        return statusCode;
-    }
-
-    public void setConnectionManager(HttpConnectionManager connectionManager) {
-        this.connectionManager = connectionManager;
-    }
 }

Modified: maven/wagon/trunk/wagon-providers/wagon-http/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-http/src/main/resources/META-INF/plexus/components.xml?rev=658099&r1=658098&r2=658099&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-http/src/main/resources/META-INF/plexus/components.xml (original)
+++ maven/wagon/trunk/wagon-providers/wagon-http/src/main/resources/META-INF/plexus/components.xml Mon May 19 22:03:57 2008
@@ -19,31 +19,17 @@
 
 <component-set>
     <components>
-	  <component>
-	    <role>org.apache.commons.httpclient.HttpConnectionManager</role>
-	    <implementation>org.apache.commons.httpclient.MultiThreadedHttpConnectionManager</implementation>
-	  </component>
       <component>
         <role>org.apache.maven.wagon.Wagon</role>
         <role-hint>http</role-hint>
         <implementation>org.apache.maven.wagon.providers.http.HttpWagon</implementation>
         <instantiation-strategy>per-lookup</instantiation-strategy>
-	    <requirements>
-		  <requirement>
-		    <role>org.apache.commons.httpclient.HttpConnectionManager</role>
-		  </requirement>
-	    </requirements>
       </component>
       <component>
         <role>org.apache.maven.wagon.Wagon</role>
         <role-hint>https</role-hint>
         <implementation>org.apache.maven.wagon.providers.http.HttpWagon</implementation>
         <instantiation-strategy>per-lookup</instantiation-strategy>
-	    <requirements>
-		  <requirement>
-		    <role>org.apache.commons.httpclient.HttpConnectionManager</role>
-		  </requirement>
-	    </requirements>
       </component>
     </components>
 </component-set>

Modified: maven/wagon/trunk/wagon-providers/wagon-scm/src/main/java/org/apache/maven/wagon/providers/scm/ScmWagon.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-scm/src/main/java/org/apache/maven/wagon/providers/scm/ScmWagon.java?rev=658099&r1=658098&r2=658099&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-scm/src/main/java/org/apache/maven/wagon/providers/scm/ScmWagon.java (original)
+++ maven/wagon/trunk/wagon-providers/wagon-scm/src/main/java/org/apache/maven/wagon/providers/scm/ScmWagon.java Mon May 19 22:03:57 2008
@@ -1,19 +1,22 @@
 package org.apache.maven.wagon.providers.scm;
 
 /*
- * Copyright 2001-2006 The Apache Software Foundation.
+ * 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
  *
- * Licensed 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
  *
- *      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.
+ * 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.
  */
 
 import org.apache.maven.scm.ScmException;
@@ -275,6 +278,9 @@
 
         ScmRepository scmRepository = getScmRepository( getRepository().getUrl() );
 
+        target.setContentLength( source.length() );
+        target.setLastModified( source.lastModified() );
+        
         firePutStarted( target, source );
 
         try

Modified: maven/wagon/trunk/wagon-providers/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/AbstractScmCvsWagonTest.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/AbstractScmCvsWagonTest.java?rev=658099&r1=658098&r2=658099&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/AbstractScmCvsWagonTest.java (original)
+++ maven/wagon/trunk/wagon-providers/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/AbstractScmCvsWagonTest.java Mon May 19 22:03:57 2008
@@ -1,19 +1,22 @@
 package org.apache.maven.wagon.providers.scm;
 
 /*
- * Copyright 2001-2006 The Apache Software Foundation.
+ * 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
  *
- * Licensed 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
  *
- *      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.
+ * 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.
  */
 
 import java.io.IOException;

Modified: maven/wagon/trunk/wagon-providers/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/AbstractScmSvnWagonTest.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/AbstractScmSvnWagonTest.java?rev=658099&r1=658098&r2=658099&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/AbstractScmSvnWagonTest.java (original)
+++ maven/wagon/trunk/wagon-providers/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/AbstractScmSvnWagonTest.java Mon May 19 22:03:57 2008
@@ -1,27 +1,27 @@
 package org.apache.maven.wagon.providers.scm;
 
 /*
- * Copyright 2001-2006 The Apache Software Foundation.
+ * 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
  *
- * Licensed 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
  *
- *      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.
+ * 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.
  */
 
-import org.codehaus.plexus.util.FileUtils;
-
-import com.sun.corba.se.spi.activation.Repository;
-
 import java.io.File;
-import java.io.IOException;
+
+import org.codehaus.plexus.util.FileUtils;
 
 /**
  * Test for ScmWagon using SVN as underlying SCM

Modified: maven/wagon/trunk/wagon-providers/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/AbstractScmWagonTest.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/AbstractScmWagonTest.java?rev=658099&r1=658098&r2=658099&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/AbstractScmWagonTest.java (original)
+++ maven/wagon/trunk/wagon-providers/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/AbstractScmWagonTest.java Mon May 19 22:03:57 2008
@@ -1,19 +1,22 @@
 package org.apache.maven.wagon.providers.scm;
 
 /*
- * Copyright 2001-2006 The Apache Software Foundation.
+ * 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
  *
- * Licensed 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
  *
- *      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.
+ * 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.
  */
 
 import java.io.File;
@@ -26,8 +29,11 @@
 import org.apache.maven.wagon.ResourceDoesNotExistException;
 import org.apache.maven.wagon.TransferFailedException;
 import org.apache.maven.wagon.Wagon;
+import org.apache.maven.wagon.WagonConstants;
 import org.apache.maven.wagon.WagonTestCase;
 import org.apache.maven.wagon.authorization.AuthorizationException;
+import org.apache.maven.wagon.events.TransferEvent;
+import org.apache.maven.wagon.resource.Resource;
 import org.codehaus.plexus.util.FileUtils;
 
 /**
@@ -95,6 +101,16 @@
         return new File( FileTestUtils.getTestOutputDir(), "/checkout-" + providerClassName );
     }
 
+    protected int getExpectedContentLengthOnGet( int expectedSize )
+    {
+        return WagonConstants.UNKNOWN_LENGTH;
+    }
+    
+    protected long getExpectedLastModifiedOnGet()
+    {
+        return 0;
+    }
+
     /**
      * The SCM id, eg. <code>svn</code>, <code>cvs</code>
      *

Modified: maven/wagon/trunk/wagon-providers/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/ScmCvsExeWagonTest.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/ScmCvsExeWagonTest.java?rev=658099&r1=658098&r2=658099&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/ScmCvsExeWagonTest.java (original)
+++ maven/wagon/trunk/wagon-providers/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/ScmCvsExeWagonTest.java Mon May 19 22:03:57 2008
@@ -1,19 +1,22 @@
 package org.apache.maven.wagon.providers.scm;
 
 /*
- * Copyright 2001-2006 The Apache Software Foundation.
+ * 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
  *
- * Licensed 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
  *
- *      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.
+ * 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.
  */
 
 import org.apache.maven.scm.provider.ScmProvider;

Modified: maven/wagon/trunk/wagon-providers/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/ScmSvnExeWagonTest.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/ScmSvnExeWagonTest.java?rev=658099&r1=658098&r2=658099&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/ScmSvnExeWagonTest.java (original)
+++ maven/wagon/trunk/wagon-providers/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/ScmSvnExeWagonTest.java Mon May 19 22:03:57 2008
@@ -1,19 +1,22 @@
 package org.apache.maven.wagon.providers.scm;
 
 /*
- * Copyright 2001-2006 The Apache Software Foundation.
+ * 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
  *
- * Licensed 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
  *
- *      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.
+ * 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.
  */
 
 import org.apache.maven.scm.provider.ScmProvider;

Modified: maven/wagon/trunk/wagon-providers/wagon-webdav/pom.xml
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-webdav/pom.xml?rev=658099&r1=658098&r2=658099&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-webdav/pom.xml (original)
+++ maven/wagon/trunk/wagon-providers/wagon-webdav/pom.xml Mon May 19 22:03:57 2008
@@ -17,7 +17,7 @@
   ~ 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"
@@ -39,26 +39,43 @@
       <name>Henry Isidro</name>
       <email>hisidro@exist.com</email>
     </contributor>
+    <contributor>
+      <name>James William Dumay</name>
+      <email>james@atlassian.com</email>
+    </contributor>
   </contributors>
 
   <dependencies>
     <dependency>
-      <groupId>slide</groupId>
-      <artifactId>slide-webdavlib</artifactId>
-      <version>2.1</version>
+      <groupId>${pom.groupId}</groupId>
+      <artifactId>wagon-http-shared</artifactId>
+      <version>1.0-rc1-SNAPSHOT</version>
     </dependency>
     <dependency>
-      <groupId>commons-logging</groupId>
-      <artifactId>commons-logging</artifactId>
-      <version>1.0.4</version>
-      <scope>runtime</scope>
+      <groupId>org.apache.jackrabbit</groupId>
+      <artifactId>jackrabbit-webdav</artifactId>
+      <version>1.4</version>
+      <exclusions>
+        <exclusion>
+          <groupId>xerces</groupId>
+          <artifactId>xercesImpl</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
     <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-utils</artifactId>
-      <version>1.4.2</version>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <version>2.3</version>
     </dependency>
     <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-simple</artifactId>
+      <version>1.5.0</version>
+      <scope>runtime</scope>
+    </dependency>
+
+    <!-- Test dependencies -->
+    <dependency>
       <groupId>it.could</groupId>
       <artifactId>webdav</artifactId>
       <version>0.4</version>



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


Mime
View raw message