org.apache.maven.wagon.providers.scm
Class AbstractScmWagonTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.codehaus.plexus.PlexusTestCase
              extended by org.apache.maven.wagon.WagonTestCase
                  extended by org.apache.maven.wagon.providers.scm.AbstractScmWagonTest
All Implemented Interfaces:
Test
Direct Known Subclasses:
AbstractScmCvsWagonTest, AbstractScmSvnWagonTest

public abstract class AbstractScmWagonTest
extends WagonTestCase

Test for ScmWagon. You need a subclass for each SCM provider you want to test.

Version:
$Id: AbstractScmWagonTest.java 1133584 2011-06-08 22:17:02Z struberg $
Author:
Carlos Sanchez

Field Summary
 
Fields inherited from class org.apache.maven.wagon.WagonTestCase
artifactDestFile, artifactSourceFile, checksumObserver, destFile, localRepository, localRepositoryPath, logger, mockTransferListener, mockTransferListenerControl, POM, resource, sourceFile, testRepository
 
Constructor Summary
AbstractScmWagonTest()
           
 
Method Summary
protected  void assertResourcesAreInRemoteSide(Wagon wagon, List resourceNames)
           
protected  void createDirectory(Wagon wagon, String resourceToCreate, String dirName)
           
protected  int getExpectedContentLengthOnGet(int expectedSize)
           
protected  long getExpectedLastModifiedOnGet(Repository repository, Resource resource)
           
protected  String getProtocol()
           
protected abstract  String getScmId()
          The SCM id, eg.
protected  org.apache.maven.scm.provider.ScmProvider getScmProvider()
          Allows overriding the ScmProvider injected by default in the ScmWagon.
protected  int getTestRepositoryPort()
           
protected  Wagon getWagon()
           
protected  void setUp()
           
 
Methods inherited from class org.apache.maven.wagon.WagonTestCase
assertGetIfNewerTest, assertNotExists, connectWagon, createFileRepository, createTransferEvent, customizeContext, disconnectWagon, fileRoundTripTesting, getAuthInfo, getFile, getPermissions, getTestRepositoryUrl, message, putFile, putFile, replaceMockForGet, replayMockForPut, setupGetIfNewerTest, setupRepositories, setupWagonTestingFixtures, supportsGetIfNewer, tearDownWagonTestingFixtures, testFailedGet, testFailedGetIfNewer, testWagon, testWagonGetFileList, testWagonGetFileListWhenDirectoryDoesNotExist, testWagonGetIfNewerIsNewer, testWagonGetIfNewerIsOlder, testWagonGetIfNewerIsSame, testWagonPutDirectory, testWagonPutDirectoryDeepDestination, testWagonPutDirectoryForDot, testWagonPutDirectoryWhenDirectoryAlreadyExists, testWagonResourceExists, testWagonResourceNotExists, verifyMock
 
Methods inherited from class org.codehaus.plexus.PlexusTestCase
customizeComponentConfiguration, customizeContainerConfiguration, customizeContext, getBasedir, getClassLoader, getConfiguration, getConfiguration, getConfigurationName, getContainer, getCustomConfigurationName, getResourceAsStream, getTestConfiguration, getTestConfiguration, getTestFile, getTestFile, getTestPath, getTestPath, lookup, lookup, lookup, lookup, release, setupContainer, tearDown
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractScmWagonTest

public AbstractScmWagonTest()
Method Detail

setUp

protected void setUp()
              throws Exception
Overrides:
setUp in class WagonTestCase
Throws:
Exception

getScmProvider

protected org.apache.maven.scm.provider.ScmProvider getScmProvider()
Allows overriding the ScmProvider injected by default in the ScmWagon. Useful to force the implementation to use for a particular SCM type. If this method returns null ScmWagon will use the default ScmProvider.

Returns:
the ScmProvider to use in the ScmWagon

getTestRepositoryPort

protected int getTestRepositoryPort()
Specified by:
getTestRepositoryPort in class WagonTestCase

getWagon

protected Wagon getWagon()
                  throws Exception
Overrides:
getWagon in class WagonTestCase
Throws:
Exception

getExpectedContentLengthOnGet

protected int getExpectedContentLengthOnGet(int expectedSize)
Overrides:
getExpectedContentLengthOnGet in class WagonTestCase

getExpectedLastModifiedOnGet

protected long getExpectedLastModifiedOnGet(Repository repository,
                                            Resource resource)
Overrides:
getExpectedLastModifiedOnGet in class WagonTestCase

getScmId

protected abstract String getScmId()
The SCM id, eg. svn, cvs

Returns:
the SCM id

getProtocol

protected String getProtocol()
Specified by:
getProtocol in class WagonTestCase

createDirectory

protected void createDirectory(Wagon wagon,
                               String resourceToCreate,
                               String dirName)
                        throws Exception
Overrides:
createDirectory in class WagonTestCase
Throws:
Exception

assertResourcesAreInRemoteSide

protected void assertResourcesAreInRemoteSide(Wagon wagon,
                                              List resourceNames)
                                       throws IOException,
                                              TransferFailedException,
                                              ResourceDoesNotExistException,
                                              AuthorizationException
Overrides:
assertResourcesAreInRemoteSide in class WagonTestCase
Throws:
IOException
TransferFailedException
ResourceDoesNotExistException
AuthorizationException


Copyright © 2003-2011 The Apache Software Foundation. All Rights Reserved.