Author: kenney
Date: Fri Jan 12 16:42:33 2007
New Revision: 495802

URL: http://svn.apache.org/viewvc?view=rev&rev=495802
Log:
Lots of fixes and improvements:

* changed the ScmCvsExeWagonTest to extend from the abstractCVS wagon test, so 
it actually
  tests CVS and not SVN

* disabled CVS testing because that is broken - it probably never worked.

* Enabled all unit tests in the WagonTestCase (removed dummy overrides in 
AbstractScmWagonTest),
  and fixed the implementation so all tests pass. Removed the use of 
provider.getParent
  since that's not implemented everywhere.

* had to update deps to cvs/svn scm's since I had to implement the list 
functionality
  for the new algorithm.

Modified:
    maven/sandbox/wagon-scm/pom.xml
    
maven/sandbox/wagon-scm/src/main/java/org/apache/maven/wagon/providers/scm/ScmWagon.java
    
maven/sandbox/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/AbstractScmSvnWagonTest.java
    
maven/sandbox/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/AbstractScmWagonTest.java
    
maven/sandbox/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/ScmCvsExeWagonTest.java

Modified: maven/sandbox/wagon-scm/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/sandbox/wagon-scm/pom.xml?view=diff&rev=495802&r1=495801&r2=495802
==============================================================================
--- maven/sandbox/wagon-scm/pom.xml (original)
+++ maven/sandbox/wagon-scm/pom.xml Fri Jan 12 16:42:33 2007
@@ -27,32 +27,45 @@
     <dependency>
       <groupId>org.apache.maven.scm</groupId>
       <artifactId>maven-scm-api</artifactId>
-      <version>1.0-beta-4</version>
+      <version>1.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.scm</groupId>
       <artifactId>maven-scm-manager-plexus</artifactId>
-      <version>1.0-beta-4</version>
+      <version>1.0-SNAPSHOT</version>
       <scope>runtime</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.scm</groupId>
       <artifactId>maven-scm-test</artifactId>
-      <version>1.0-beta-4</version>
+      <version>1.0-SNAPSHOT</version>
       <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.scm</groupId>
       <artifactId>maven-scm-provider-cvsexe</artifactId>
-      <version>1.0-beta-4</version>
+      <version>1.0-beta-4</version><!--SNAPSHOT</version>-->
       <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.scm</groupId>
       <artifactId>maven-scm-provider-svnexe</artifactId>
-      <version>1.0-beta-4</version>
+      <version>1.0-SNAPSHOT</version>
       <scope>test</scope>
     </dependency>
   </dependencies>
 
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <excludes>
+            <!-- disable testing the CVS SCM as CVS is broken -->
+            <exclude>**/*Cvs*.java</exclude>
+          </excludes>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
 </project>

Modified: 
maven/sandbox/wagon-scm/src/main/java/org/apache/maven/wagon/providers/scm/ScmWagon.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/wagon-scm/src/main/java/org/apache/maven/wagon/providers/scm/ScmWagon.java?view=diff&rev=495802&r1=495801&r2=495802
==============================================================================
--- 
maven/sandbox/wagon-scm/src/main/java/org/apache/maven/wagon/providers/scm/ScmWagon.java
 (original)
+++ 
maven/sandbox/wagon-scm/src/main/java/org/apache/maven/wagon/providers/scm/ScmWagon.java
 Fri Jan 12 16:42:33 2007
@@ -16,10 +16,8 @@
  * limitations under the License.
  */
 
-import java.io.File;
-import java.io.IOException;
-
 import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFile;
 import org.apache.maven.scm.ScmFileSet;
 import org.apache.maven.scm.ScmResult;
 import org.apache.maven.scm.command.add.AddScmResult;
@@ -42,12 +40,19 @@
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.StringUtils;
 
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Stack;
+
 /**
- * Wagon provider to get and put files form and to SCM systems, using 
Maven-SCM as underlying transport.
- * 
- * TODO it probably creates problems if the same wagon is used in two 
different SCM protocols, as
- * instance variables can keep incorrect state.
- * 
+ * Wagon provider to get and put files from and to SCM systems, using 
Maven-SCM as underlying transport.
+ *
+ * TODO it probably creates problems if the same wagon is used in two 
different SCM protocols, as instance variables can
+ * keep incorrect state.
+ *
  * @author <a href="[EMAIL PROTECTED]">Brett Porter</a>
  * @author <a href="[EMAIL PROTECTED]">Emmanuel Venisse</a>
  * @author <a href="[EMAIL PROTECTED]">Carlos Sanchez</a>
@@ -62,7 +67,7 @@
 
     /**
      * Get the [EMAIL PROTECTED] ScmManager} used in this Wagon
-     * 
+     *
      * @return rhe [EMAIL PROTECTED] ScmManager}
      */
     public ScmManager getScmManager()
@@ -72,7 +77,7 @@
 
     /**
      * Set the [EMAIL PROTECTED] ScmManager} used in this Wagon
-     * 
+     *
      * @param scmManager
      */
     public void setScmManager( ScmManager scmManager )
@@ -81,9 +86,8 @@
     }
 
     /**
-     * Get the directory where Wagon will checkout files from SCM.
-     * This directory will be deleted! 
-     * 
+     * Get the directory where Wagon will checkout files from SCM. This 
directory will be deleted!
+     *
      * @return directory
      */
     public File getCheckoutDirectory()
@@ -92,9 +96,8 @@
     }
 
     /**
-     * Set the directory where Wagon will checkout files from SCM.
-     * This directory will be deleted! 
-     * 
+     * Set the directory where Wagon will checkout files from SCM. This 
directory will be deleted!
+     *
      * @param checkoutDirectory
      */
     public void setCheckoutDirectory( File checkoutDirectory )
@@ -104,7 +107,7 @@
 
     /**
      * Convenience method to get the [EMAIL PROTECTED] ScmProvider} 
implementation to handle the provided SCM type
-     * 
+     *
      * @param scmType type of SCM, eg. <code>svn</code>, <code>cvs</code>
      * @return the [EMAIL PROTECTED] ScmProvider} that will handle provided 
SCM type
      * @throws NoSuchScmProviderException if there is no [EMAIL PROTECTED] 
ScmProvider} able to handle that SCM type
@@ -116,7 +119,7 @@
     }
 
     /**
-     * This will cleanup the checkout directory 
+     * This will cleanup the checkout directory
      */
     public void openConnection()
         throws ConnectionException
@@ -202,48 +205,46 @@
         return scmRepository;
     }
 
-    public void put( File source, String resourceName )
+    public void put( File source, String targetName )
         throws TransferFailedException, ResourceDoesNotExistException, 
AuthorizationException
     {
         if ( source.isDirectory() )
         {
             throw new IllegalArgumentException( "Source is a directory: " + 
source );
         }
-        putInternal( source, resourceName );
+        putInternal( source, targetName );
     }
 
     /**
      * Puts both files and directories
      * @param source
-     * @param resourceName
+     * @param targetName
      * @throws TransferFailedException
      */
-    private void putInternal( File source, String resourceName )
+    private void putInternal( File source, String targetName )
         throws TransferFailedException
     {
-        Resource resource = new Resource( resourceName );
+        Resource target = new Resource( targetName );
 
-        firePutInitiated( resource, source );
+        firePutInitiated( target, source );
 
-        String url = getRepository().getUrl();
+        ScmRepository scmRepository = getScmRepository( 
getRepository().getUrl() );
 
-        ScmRepository scmRepository = getScmRepository( url );
-
-        firePutStarted( resource, source );
+        firePutStarted( target, source );
 
         try
         {
-            File basedir = checkoutDirectory;
-
             String msg = "Wagon: Adding " + source.getName() + " to 
repository";
 
             ScmProvider scmProvider = getScmProvider( 
scmRepository.getProvider() );
 
-            ScmResult result;
+            String relPath = checkOut( scmProvider, scmRepository, 
source.isDirectory() ? targetName : FileUtils
+                .dirname( targetName ) );
+            File newCheckoutDirectory = new File( checkoutDirectory, relPath );
 
-            File newCheckoutDirectory = mkdirs( scmProvider, scmRepository, 
basedir );
+            ScmResult result;
 
-            File scmFile = new File( newCheckoutDirectory, resourceName );
+            File scmFile = new File( newCheckoutDirectory, 
source.isDirectory() ? "" : FileUtils.filename( targetName ) );
 
             boolean fileAlreadyInScm = scmFile.exists();
 
@@ -261,18 +262,19 @@
 
             if ( !fileAlreadyInScm || scmFile.isDirectory() )
             {
-                int addedFiles = addFiles( scmProvider, scmRepository, 
newCheckoutDirectory, scmFile.getName() );
+                int addedFiles = addFiles( scmProvider, scmRepository, 
newCheckoutDirectory, source.isDirectory() ? ""
+                    : scmFile.getName() );
 
                 if ( !fileAlreadyInScm && addedFiles == 0 )
                 {
-                    throw new TransferFailedException( "Unable to add file to 
SCM: " + scmFile + "; see error messages above for more information" );
+                    throw new TransferFailedException( "Unable to add file to 
SCM: " + scmFile
+                        + "; see error messages above for more information" );
                 }
             }
 
-            result = scmProvider.checkIn( scmRepository, new ScmFileSet( 
newCheckoutDirectory, scmFile.getName(), null ), null, msg );
+            result = scmProvider.checkIn( scmRepository, new ScmFileSet( 
checkoutDirectory ), null, msg );
 
             checkScmResult( result );
-
         }
         catch ( ScmException e )
         {
@@ -285,146 +287,157 @@
 
         if ( source.isFile() )
         {
-            postProcessListeners( resource, source, TransferEvent.REQUEST_PUT 
);
+            postProcessListeners( target, source, TransferEvent.REQUEST_PUT );
         }
 
-        firePutCompleted( resource, source );
+        firePutCompleted( target, source );
     }
 
     /**
-     * Add a file or directory to a SCM repository.
-     * If it's a directory all its contents are added recursively.
-     * 
-     * TODO this is less than optimal, SCM API should provide a way to add a 
directory recursively
-     * 
-     * @param scmProvider SCM provider
-     * @param scmRepository SCM repository
-     * @param basedir local directory corresponding to scmRepository
-     * @param scmFilePath path of the file or directory to add, relative to 
basedir
-     * @throws ScmException
-     * @return the number of files added.
+     * Returns the relative path to targetName in the checkout dir. If the 
targetName already exists in the scm, this
+     * will be the empty string.
+     *
+     * @param scmProvider
+     * @param scmRepository
+     * @param targetName
+     * @return
+     * @throws TransferFailedException
      */
-    private int addFiles( ScmProvider scmProvider, ScmRepository 
scmRepository, File basedir, String scmFilePath )
-        throws ScmException, TransferFailedException
+    private String checkOut( ScmProvider scmProvider, ScmRepository 
scmRepository, String targetName )
+        throws TransferFailedException
     {
-        File scmFile = new File( basedir, scmFilePath );
+        Stack stack = new Stack();
 
-        AddScmResult result = scmProvider.add( scmRepository, new ScmFileSet( 
basedir, new File( scmFilePath ) ) );
+        String target = targetName;
 
-        /* 
-         * TODO dirty fix to work around files with property 
svn:eol-style=native
-         * if a file has that property, first time file is added it fails, 
second time it succeeds
-         * the solution is check if the scm provider is svn and unset that 
property
-         * when the SCM API allows it 
-         */
-        if ( !result.isSuccess() )
+        // totally ignore scmRepository parent stuff since that is not 
supported by all scms.
+        // Instead, assume that that url exists. If not, then that's an error.
+        // Check wheter targetName, which is a relative path into the scm, 
exists.
+        // If it doesn't, check the parent, etc.
+
+        try
         {
-            result = scmProvider.add( scmRepository, new ScmFileSet( basedir, 
new File( scmFilePath ) ) );
+            while ( target.length() > 0
+                && !scmProvider
+                    .list( scmRepository, new ScmFileSet( new File( "." ), new 
File( target ) ), false, null )
+                    .isSuccess() )
+            {
+                stack.push( FileUtils.filename( target ) );
+                target = FileUtils.dirname( target );
+            }
+        }
+        catch ( ScmException e )
+        {
+            throw new TransferFailedException( "Error listing repository", e );
         }
 
-        int addedFiles = result.getAddedFiles().size();
+        // ok, we've established that target exists, or is empty.
+        // Check the resource out; if it doesn't exist, that means we're in 
the svn repo url root,
+        // and the configuration is incorrect. We will not try repo.getParent 
since most scm's don't
+        // implement that.
 
-        String reservedScmFile = scmProvider.getScmSpecificFilename();
+        try
+        {
+            scmRepository = getScmRepository( getRepository().getUrl() + "/" + 
target );
 
-        if ( scmFile.isDirectory() )
+            CheckOutScmResult ret = scmProvider.checkOut( scmRepository, new 
ScmFileSet( new File(
+                checkoutDirectory,
+                "" ) ), null, false );
+
+            checkScmResult( ret );
+        }
+        catch ( ScmException e )
         {
-            File[] files = scmFile.listFiles();
+            throw new TransferFailedException( "Error checking out", e );
+        }
 
-            for ( int i = 0; i < files.length; i++ )
+        // now create the subdirs in target, if it's a parent of targetName
+
+        String relPath = "";
+
+        while ( !stack.isEmpty() )
+        {
+            String p = (String) stack.pop();
+            relPath += p + "/";
+
+            File newDir = new File( checkoutDirectory, relPath );
+            if ( !newDir.mkdir() )
             {
-                if ( reservedScmFile != null && !reservedScmFile.equals( 
files[i].getName() ) )
-                {
-                    addedFiles += addFiles( scmProvider, scmRepository, 
basedir, scmFilePath + "/" + files[i].getName() );
-                }
+                throw new TransferFailedException( "Failed to create directory 
" + newDir.getAbsolutePath()
+                    + "; parent should exist: " + checkoutDirectory );
+            }
+
+            try
+            {
+                scmProvider.add( scmRepository, new ScmFileSet( 
checkoutDirectory, new File( relPath ) ) );
+            }
+            catch ( ScmException e )
+            {
+                throw new TransferFailedException( "Failed to add directory " 
+ newDir + " to working copy", e );
             }
         }
 
-        return addedFiles;
+        return relPath;
     }
 
     /**
-     * Make the necessary directories in the SCM repository to commit the 
files in the place asked
-     * 
-     * @param scmProvider
-     * @param repository
-     * @param basedir
-     * @return the new checkout directory. Will be <code>null</code> if it 
does not need to change.
+     * Add a file or directory to a SCM repository. If it's a directory all 
its contents are added recursively.
+     *
+     * TODO this is less than optimal, SCM API should provide a way to add a 
directory recursively
+     *
+     * @param scmProvider SCM provider
+     * @param scmRepository SCM repository
+     * @param basedir local directory corresponding to scmRepository
+     * @param scmFilePath path of the file or directory to add, relative to 
basedir
      * @throws ScmException
-     * @throws TransferFailedException
+     * @return the number of files added.
      */
-    private File mkdirs( ScmProvider scmProvider, ScmRepository repository, 
File basedir )
+    private int addFiles( ScmProvider scmProvider, ScmRepository 
scmRepository, File basedir, String scmFilePath )
         throws ScmException, TransferFailedException
     {
-        ScmProviderRepository baseProviderRepository = 
repository.getProviderRepository();
+        int addedFiles = 0;
 
-        ScmFileSet fileSet = new ScmFileSet( basedir, new File( "." ) );
-
-        ListScmResult listScmResult;
-
-        ScmRepository baseRepository = repository;
-        
-        ScmProviderRepository lastBaseProviderRepository = 
baseProviderRepository;
+        File scmFile = new File( basedir, scmFilePath );
 
-        while ( baseProviderRepository != null )
+        if ( scmFilePath.length() != 0 )
         {
-            listScmResult = scmProvider.list( baseRepository, fileSet, false, 
null );
+            AddScmResult result = scmProvider.add( scmRepository, new 
ScmFileSet( basedir, new File( scmFilePath ) ) );
 
-            if ( listScmResult.isSuccess() )
+            /*
+             * TODO dirty fix to work around files with property 
svn:eol-style=native if a file has that property, first
+             * time file is added it fails, second time it succeeds the 
solution is check if the scm provider is svn and
+             * unset that property when the SCM API allows it
+             */
+            if ( !result.isSuccess() )
             {
-                break;
+                result = scmProvider.add( scmRepository, new ScmFileSet( 
basedir, new File( scmFilePath ) ) );
             }
 
-            lastBaseProviderRepository = baseProviderRepository;
-
-            baseProviderRepository = baseProviderRepository.getParent();
-
-            baseRepository = new ScmRepository( repository.getProvider(), 
baseProviderRepository );
+            addedFiles = result.getAddedFiles().size();
         }
 
-        if ( baseProviderRepository != null )
+        String reservedScmFile = scmProvider.getScmSpecificFilename();
+
+        if ( scmFile.isDirectory() )
         {
-            String relativePath = 
repository.getProviderRepository().getRelativePath( baseProviderRepository );
+            File[] files = scmFile.listFiles();
 
-            if ( relativePath != null )
+            for ( int i = 0; i < files.length; i++ )
             {
-                scmProvider.checkOut( baseRepository, new ScmFileSet( basedir 
), null );
-                
-                File path = new File( basedir, relativePath );
-                
-                path.mkdirs();
-                
-                String folderNameToCommit = 
lastBaseProviderRepository.getRelativePath( baseProviderRepository );
-
-                int addedFiles = addFiles( scmProvider, baseRepository, 
basedir, folderNameToCommit );
-
-                if ( addedFiles == 0 )
+                if ( reservedScmFile != null && !reservedScmFile.equals( 
files[i].getName() ) )
                 {
-                    throw new TransferFailedException( "Unable to add folder 
to SCM: " + new File( basedir, folderNameToCommit ) );
+                    addedFiles += addFiles( scmProvider, scmRepository, 
basedir, ( scmFilePath.length() == 0 ? ""
+                        : scmFilePath + "/" )
+                        + files[i].getName() );
                 }
-
-                scmProvider.checkIn( baseRepository, new ScmFileSet( basedir, 
new File( folderNameToCommit ) ), null,
-                                     "Adding required folders for Wagon.put" );
-
-                return path;
-            }
-            else
-            {
-                /* folder already in SCM */
-
-                CheckOutScmResult result = scmProvider.checkOut( repository, 
new ScmFileSet( basedir ), null );
-
-                checkScmResult( result );
-
-                return basedir;
             }
         }
 
-        throw new TransferFailedException( "Unable to create directories in 
the remote repository: "
-            + repository.getProviderRepository() );
+        return addedFiles;
     }
 
     /**
-     * @return true 
+     * @return true
      */
     public boolean supportsDirectoryCopy()
     {
@@ -453,7 +466,7 @@
         if ( !result.isSuccess() )
         {
             throw new TransferFailedException( "Unable to commit file. " + 
result.getProviderMessage() + " "
-                + result.getCommandOutput() );
+                + ( result.getCommandOutput() == null ? "" : 
result.getCommandOutput() ) );
         }
     }
 
@@ -463,7 +476,7 @@
 
     /**
      * Not implemented
-     * 
+     *
      * @throws UnsupportedOperationException always
      */
     public boolean getIfNewer( String resourceName, File destination, long 
timestamp )
@@ -489,10 +502,10 @@
         fireGetStarted( resource, destination );
 
         // TODO: limitations:
-        //  - destination filename must match that in the repository - should 
allow the "-d" CVS equiv to be passed in
-        //  - we don't get granular exceptions from SCM (ie, auth, not found)
-        //  - need to make it non-recursive to save time
-        //  - exists() check doesn't test if it is in SCM already
+        // - destination filename must match that in the repository - should 
allow the "-d" CVS equiv to be passed in
+        // - we don't get granular exceptions from SCM (ie, auth, not found)
+        // - need to make it non-recursive to save time
+        // - exists() check doesn't test if it is in SCM already
 
         try
         {
@@ -539,4 +552,59 @@
         fireGetCompleted( resource, destination );
     }
 
+    /**
+     * @return a List&lt;String&gt; with filenames/directories at the 
resourcepath.
+     * @see org.apache.maven.wagon.AbstractWagon#getFileList(java.lang.String)
+     */
+    public List getFileList( String resourcePath )
+        throws TransferFailedException, ResourceDoesNotExistException, 
AuthorizationException
+    {
+        ScmRepository repository = getScmRepository( getRepository().getUrl() 
);
+
+        try
+        {
+            ScmProvider provider = getScmProvider( repository.getProvider() );
+
+            ListScmResult result = provider.list( repository,
+                                                  new ScmFileSet( new File( 
"." ), new File( resourcePath ) ),
+                                                  false,
+                                                  null );
+
+            if ( !result.isSuccess() )
+            {
+                throw new ResourceDoesNotExistException( 
result.getProviderMessage() );
+            }
+
+            // List<String>
+            List files = new ArrayList();
+
+            for ( Iterator it = result.getFiles().iterator(); it.hasNext(); )
+            {
+                ScmFile f = (ScmFile) it.next();
+                files.add( f.getPath() );
+                System.out.println( "LIST FILE: " + f + " (path=" + 
f.getPath() + ")" );
+            }
+
+            return files;
+        }
+        catch ( ScmException e )
+        {
+            e.printStackTrace();
+            throw new TransferFailedException( "Error getting filelist from 
SCM", e );
+        }
+    }
+
+    public boolean resourceExists( String resourceName )
+        throws TransferFailedException, AuthorizationException
+    {
+        try
+        {
+            getFileList( resourceName );
+            return true;
+        }
+        catch ( ResourceDoesNotExistException e )
+        {
+            return false;
+        }
+    }
 }

Modified: 
maven/sandbox/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/AbstractScmSvnWagonTest.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/AbstractScmSvnWagonTest.java?view=diff&rev=495802&r1=495801&r2=495802
==============================================================================
--- 
maven/sandbox/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/AbstractScmSvnWagonTest.java
 (original)
+++ 
maven/sandbox/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/AbstractScmSvnWagonTest.java
 Fri Jan 12 16:42:33 2007
@@ -16,36 +16,59 @@
  * 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;
 
 /**
  * Test for ScmWagon using SVN as underlying SCM
- * 
+ *
  * @author <a href="[EMAIL PROTECTED]">Brett Porter</a>
  * @version $Id$
  */
 public class AbstractScmSvnWagonTest
     extends AbstractScmWagonTest
 {
+    private String repository;
 
-    protected String getScmId()
+    protected void setUp()
+        throws Exception
     {
-        return "svn";
-    }
+        super.setUp();
 
-    protected String getTestRepositoryUrl()
-        throws IOException
-    {
-        String repository = getTestFile( "target/test-classes/test-repo-svn" 
).getAbsolutePath();
+        // copy the repo for the test
+
+        File origRepo = getTestFile( "target/test-classes/test-repo-svn" );
+
+        File testRepo = getTestFile( "target/test-classes/test-repo-svn-test" 
);
+
+        FileUtils.deleteDirectory( testRepo );
+
+        FileUtils.copyDirectoryStructure( origRepo, testRepo );
+
+        repository = testRepo.getAbsolutePath();
 
         // TODO: this is a hack for windows
+        // Note: why not use File.toURL() ?
         if ( repository.indexOf( ":" ) >= 0 )
         {
             repository = "/" + repository;
         }
         repository = repository.replace( '\\', '/' );
 
-        return "scm:svn:file://" + repository;
+        repository = "scm:svn:file://" + repository;
+    }
+
+    protected String getScmId()
+    {
+        return "svn";
     }
 
+    protected String getTestRepositoryUrl()
+    {
+        return repository;
+    }
 }

Modified: 
maven/sandbox/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/AbstractScmWagonTest.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/AbstractScmWagonTest.java?view=diff&rev=495802&r1=495801&r2=495802
==============================================================================
--- 
maven/sandbox/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/AbstractScmWagonTest.java
 (original)
+++ 
maven/sandbox/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/AbstractScmWagonTest.java
 Fri Jan 12 16:42:33 2007
@@ -32,7 +32,7 @@
 
 /**
  * Test for [EMAIL PROTECTED] ScmWagon}. You need a subclass for each SCM 
provider you want to test.
- * 
+ *
  * @author <a href="[EMAIL PROTECTED]">Carlos Sanchez</a>
  * @version $Id$
  */
@@ -76,7 +76,7 @@
      * Allows overriding the [EMAIL PROTECTED] ScmProvider} injected by 
default in the [EMAIL PROTECTED] ScmWagon}.
      * Useful to force the implementation to use for a particular SCM type.
      * If this method returns <code>null</code> [EMAIL PROTECTED] ScmWagon} 
will use the default [EMAIL PROTECTED] ScmProvider}.
-     *  
+     *
      * @return the [EMAIL PROTECTED] ScmProvider} to use in the [EMAIL 
PROTECTED] ScmWagon}
      */
     protected ScmProvider getScmProvider()
@@ -97,7 +97,7 @@
 
     /**
      * The SCM id, eg. <code>svn</code>, <code>cvs</code>
-     * 
+     *
      * @return the SCM id
      */
     protected abstract String getScmId();
@@ -119,30 +119,5 @@
     {
         FileUtils.deleteDirectory( getCheckoutDirectory() );
         super.assertResourcesAreInRemoteSide( wagon, resourceNames );
-    }
-
-    public void testWagonGetFileListWhenDirectoryDoesNotExist()
-    {
-        // TODO: remove once implemented in wagon
-    }
-
-    public void testWagonGetFileList()
-    {
-        // TODO: remove once implemented in wagon
-    }
-
-    public void testWagonResourceExists()
-    {
-        // TODO: remove once implemented in wagon
-    }
-
-    public void testWagonResourceNotExists()
-    {
-        // TODO: remove once implemented in wagon
-    }
-
-    public void testWagonPutDirectoryDeepDestination()
-    {
-        // TODO: remove once test is fixed
     }
 }

Modified: 
maven/sandbox/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/ScmCvsExeWagonTest.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/ScmCvsExeWagonTest.java?view=diff&rev=495802&r1=495801&r2=495802
==============================================================================
--- 
maven/sandbox/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/ScmCvsExeWagonTest.java
 (original)
+++ 
maven/sandbox/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/ScmCvsExeWagonTest.java
 Fri Jan 12 16:42:33 2007
@@ -21,12 +21,12 @@
 
 /**
  * Test for ScmWagon using CVS Exe as underlying SCM
- * 
+ *
  * @author <a href="[EMAIL PROTECTED]">Carlos Sanchez</a>
  * @version $Id$
  */
 public class ScmCvsExeWagonTest
-    extends AbstractScmSvnWagonTest
+    extends AbstractScmCvsWagonTest
 {
 
     protected ScmProvider getScmProvider()


Reply via email to