public abstract class WagonTestCase
extends org.codehaus.plexus.PlexusTestCase
Modifier and Type | Field and Description |
---|---|
protected java.io.File |
artifactDestFile |
protected java.io.File |
artifactSourceFile |
protected ChecksumObserver |
checksumObserver |
protected java.io.File |
destFile |
protected Repository |
localRepository |
protected java.lang.String |
localRepositoryPath |
protected TransferListener |
mockTransferListener |
protected org.easymock.MockControl |
mockTransferListenerControl |
protected static java.lang.String |
POM |
protected java.lang.String |
resource |
protected java.io.File |
sourceFile |
protected Repository |
testRepository |
Constructor and Description |
---|
WagonTestCase() |
Modifier and Type | Method and Description |
---|---|
protected void |
assertGetIfNewerTest(org.apache.maven.wagon.WagonTestCase.ProgressArgumentMatcher progressArgumentMatcher,
boolean expectedResult,
int expectedSize) |
protected void |
assertNotExists(Wagon wagon,
java.lang.String resourceName)
Assert that a resource does not exist in the remote wagon system
|
protected void |
assertResourcesAreInRemoteSide(Wagon wagon,
java.util.List resourceNames) |
protected void |
connectWagon(Wagon wagon) |
protected void |
createDirectory(Wagon wagon,
java.lang.String resourceToCreate,
java.lang.String dirName)
Create a directory with a resource and check that the other ones don't exist
|
protected Repository |
createFileRepository(java.lang.String url) |
protected TransferEvent |
createTransferEvent(Wagon wagon,
Resource resource,
int eventType,
int requestType,
java.io.File file) |
protected void |
customizeContext() |
protected void |
disconnectWagon(Wagon wagon) |
protected void |
fileRoundTripTesting() |
protected AuthenticationInfo |
getAuthInfo() |
protected int |
getExpectedContentLengthOnGet(int expectedSize) |
protected long |
getExpectedLastModifiedOnGet(Repository repository,
Resource resource) |
protected void |
getFile(int expectedSize) |
protected RepositoryPermissions |
getPermissions() |
protected abstract java.lang.String |
getProtocol()
Protocol id of the Wagon to use, eg.
|
protected abstract int |
getTestRepositoryPort()
The number of the port which should get used to start the test server
|
protected abstract java.lang.String |
getTestRepositoryUrl()
URL of the repository.
|
protected Wagon |
getWagon() |
protected void |
message(java.lang.String message) |
protected int |
putFile() |
protected void |
putFile(java.lang.String resourceName,
java.lang.String testFileName,
java.lang.String content) |
protected org.apache.maven.wagon.WagonTestCase.ProgressArgumentMatcher |
replaceMockForGet(Wagon wagon,
int expectedSize) |
protected org.apache.maven.wagon.WagonTestCase.ProgressArgumentMatcher |
replayMockForPut(java.lang.String resourceName,
java.lang.String content,
Wagon wagon) |
protected void |
setUp() |
protected org.apache.maven.wagon.WagonTestCase.ProgressArgumentMatcher |
setupGetIfNewerTest(Wagon wagon,
boolean expectedResult,
int expectedSize) |
protected void |
setupRepositories() |
protected void |
setupWagonTestingFixtures() |
protected boolean |
supportsGetIfNewer() |
protected void |
tearDownWagonTestingFixtures() |
void |
testFailedGet() |
void |
testFailedGetIfNewer() |
void |
testWagon() |
void |
testWagonGetFileList()
|
void |
testWagonGetFileListWhenDirectoryDoesNotExist()
Test
Wagon.getFileList(String) when the directory does not exist. |
void |
testWagonGetIfNewerIsNewer() |
void |
testWagonGetIfNewerIsOlder() |
void |
testWagonGetIfNewerIsSame() |
void |
testWagonPutDirectory() |
void |
testWagonPutDirectoryDeepDestination()
Test for putting a directory with a destination that multiple directories deep, all of which haven't been
created.
|
void |
testWagonPutDirectoryForDot()
Test that when putting a directory that already exists new files get also copied and destination is "."
|
void |
testWagonPutDirectoryWhenDirectoryAlreadyExists()
Test that when putting a directory that already exists new files get also copied
|
void |
testWagonResourceExists()
Test for an existing resource.
|
void |
testWagonResourceNotExists()
Test for an invalid resource.
|
protected void |
verifyMock(org.apache.maven.wagon.WagonTestCase.ProgressArgumentMatcher progressArgumentMatcher,
int length) |
createContainerInstance, customizeContext, getBasedir, getClassLoader, getConfiguration, getConfiguration, getContainer, getCustomConfiguration, getResourceAsStream, getTestFile, getTestFile, getTestPath, getTestPath, lookup, lookup, release, tearDown
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, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toString
protected static java.lang.String POM
protected Repository localRepository
protected Repository testRepository
protected java.lang.String localRepositoryPath
protected java.io.File sourceFile
protected java.io.File destFile
protected java.lang.String resource
protected java.io.File artifactSourceFile
protected java.io.File artifactDestFile
protected ChecksumObserver checksumObserver
protected TransferListener mockTransferListener
protected org.easymock.MockControl mockTransferListenerControl
protected void setUp() throws java.lang.Exception
setUp
in class org.codehaus.plexus.PlexusTestCase
java.lang.Exception
protected abstract java.lang.String getTestRepositoryUrl() throws java.io.IOException
java.io.IOException
protected abstract java.lang.String getProtocol()
scp
, ftp
protected abstract int getTestRepositoryPort()
protected void setupRepositories() throws java.lang.Exception
java.lang.Exception
protected void customizeContext() throws java.lang.Exception
customizeContext
in class org.codehaus.plexus.PlexusTestCase
java.lang.Exception
protected void setupWagonTestingFixtures() throws java.lang.Exception
java.lang.Exception
protected void tearDownWagonTestingFixtures() throws java.lang.Exception
java.lang.Exception
protected AuthenticationInfo getAuthInfo()
protected RepositoryPermissions getPermissions()
protected Wagon getWagon() throws java.lang.Exception
java.lang.Exception
protected void message(java.lang.String message)
public void testWagon() throws java.lang.Exception
java.lang.Exception
public void testWagonGetIfNewerIsNewer() throws java.lang.Exception
java.lang.Exception
protected boolean supportsGetIfNewer()
public void testWagonGetIfNewerIsOlder() throws java.lang.Exception
java.lang.Exception
public void testWagonGetIfNewerIsSame() throws java.lang.Exception
java.lang.Exception
protected void assertGetIfNewerTest(org.apache.maven.wagon.WagonTestCase.ProgressArgumentMatcher progressArgumentMatcher, boolean expectedResult, int expectedSize) throws java.io.IOException
java.io.IOException
protected org.apache.maven.wagon.WagonTestCase.ProgressArgumentMatcher setupGetIfNewerTest(Wagon wagon, boolean expectedResult, int expectedSize) throws java.security.NoSuchAlgorithmException, java.io.IOException
java.security.NoSuchAlgorithmException
java.io.IOException
public void testWagonPutDirectory() throws java.lang.Exception
java.lang.Exception
public void testWagonPutDirectoryDeepDestination() throws java.lang.Exception
java.lang.Exception
public void testWagonPutDirectoryWhenDirectoryAlreadyExists() throws java.lang.Exception
java.lang.Exception
public void testWagonPutDirectoryForDot() throws java.lang.Exception
java.lang.Exception
protected void createDirectory(Wagon wagon, java.lang.String resourceToCreate, java.lang.String dirName) throws java.lang.Exception
wagon
- resourceToCreate
- name of the resource to be createddirName
- directory name to createjava.lang.Exception
protected void assertResourcesAreInRemoteSide(Wagon wagon, java.util.List resourceNames) throws java.io.IOException, TransferFailedException, ResourceDoesNotExistException, AuthorizationException
java.io.IOException
TransferFailedException
ResourceDoesNotExistException
AuthorizationException
protected void assertNotExists(Wagon wagon, java.lang.String resourceName) throws java.io.IOException, TransferFailedException, AuthorizationException
wagon
- wagon to get the resource fromresourceName
- name of the resourcejava.io.IOException
- if a temp file can't be createdAuthorizationException
TransferFailedException
public void testFailedGet() throws java.lang.Exception
java.lang.Exception
public void testFailedGetIfNewer() throws java.lang.Exception
java.lang.Exception
public void testWagonGetFileList() throws java.lang.Exception
java.lang.Exception
public void testWagonGetFileListWhenDirectoryDoesNotExist() throws java.lang.Exception
Wagon.getFileList(String)
when the directory does not exist.java.lang.Exception
public void testWagonResourceExists() throws java.lang.Exception
java.lang.Exception
public void testWagonResourceNotExists() throws java.lang.Exception
java.lang.Exception
protected void putFile(java.lang.String resourceName, java.lang.String testFileName, java.lang.String content) throws java.lang.Exception
java.lang.Exception
protected org.apache.maven.wagon.WagonTestCase.ProgressArgumentMatcher replayMockForPut(java.lang.String resourceName, java.lang.String content, Wagon wagon)
protected TransferEvent createTransferEvent(Wagon wagon, Resource resource, int eventType, int requestType, java.io.File file)
protected int putFile() throws java.lang.Exception
java.lang.Exception
protected void getFile(int expectedSize) throws java.lang.Exception
java.lang.Exception
protected void verifyMock(org.apache.maven.wagon.WagonTestCase.ProgressArgumentMatcher progressArgumentMatcher, int length)
protected void disconnectWagon(Wagon wagon) throws ConnectionException
ConnectionException
protected void connectWagon(Wagon wagon) throws ConnectionException, AuthenticationException
protected org.apache.maven.wagon.WagonTestCase.ProgressArgumentMatcher replaceMockForGet(Wagon wagon, int expectedSize)
protected int getExpectedContentLengthOnGet(int expectedSize)
protected long getExpectedLastModifiedOnGet(Repository repository, Resource resource)
protected void fileRoundTripTesting() throws java.lang.Exception
java.lang.Exception
protected Repository createFileRepository(java.lang.String url)
Copyright © 2003-2013. All Rights Reserved.