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, tearDownassertEquals, 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, toStringprotected 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.PlexusTestCasejava.lang.Exceptionprotected abstract java.lang.String getTestRepositoryUrl()
throws java.io.IOException
java.io.IOExceptionprotected abstract java.lang.String getProtocol()
scp, ftpprotected abstract int getTestRepositoryPort()
protected void setupRepositories()
throws java.lang.Exception
java.lang.Exceptionprotected void customizeContext()
throws java.lang.Exception
customizeContext in class org.codehaus.plexus.PlexusTestCasejava.lang.Exceptionprotected void setupWagonTestingFixtures()
throws java.lang.Exception
java.lang.Exceptionprotected void tearDownWagonTestingFixtures()
throws java.lang.Exception
java.lang.Exceptionprotected AuthenticationInfo getAuthInfo()
protected RepositoryPermissions getPermissions()
protected Wagon getWagon() throws java.lang.Exception
java.lang.Exceptionprotected void message(java.lang.String message)
public void testWagon()
throws java.lang.Exception
java.lang.Exceptionpublic void testWagonGetIfNewerIsNewer()
throws java.lang.Exception
java.lang.Exceptionprotected boolean supportsGetIfNewer()
public void testWagonGetIfNewerIsOlder()
throws java.lang.Exception
java.lang.Exceptionpublic void testWagonGetIfNewerIsSame()
throws java.lang.Exception
java.lang.Exceptionprotected void assertGetIfNewerTest(org.apache.maven.wagon.WagonTestCase.ProgressArgumentMatcher progressArgumentMatcher,
boolean expectedResult,
int expectedSize)
throws java.io.IOException
java.io.IOExceptionprotected org.apache.maven.wagon.WagonTestCase.ProgressArgumentMatcher setupGetIfNewerTest(Wagon wagon, boolean expectedResult, int expectedSize) throws java.security.NoSuchAlgorithmException, java.io.IOException
java.security.NoSuchAlgorithmExceptionjava.io.IOExceptionpublic void testWagonPutDirectory()
throws java.lang.Exception
java.lang.Exceptionpublic void testWagonPutDirectoryDeepDestination()
throws java.lang.Exception
java.lang.Exceptionpublic void testWagonPutDirectoryWhenDirectoryAlreadyExists()
throws java.lang.Exception
java.lang.Exceptionpublic void testWagonPutDirectoryForDot()
throws java.lang.Exception
java.lang.Exceptionprotected 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.Exceptionprotected void assertResourcesAreInRemoteSide(Wagon wagon, java.util.List resourceNames) throws java.io.IOException, TransferFailedException, ResourceDoesNotExistException, AuthorizationException
java.io.IOExceptionTransferFailedExceptionResourceDoesNotExistExceptionAuthorizationExceptionprotected 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 createdAuthorizationExceptionTransferFailedExceptionpublic void testFailedGet()
throws java.lang.Exception
java.lang.Exceptionpublic void testFailedGetIfNewer()
throws java.lang.Exception
java.lang.Exceptionpublic void testWagonGetFileList()
throws java.lang.Exception
java.lang.Exceptionpublic void testWagonGetFileListWhenDirectoryDoesNotExist()
throws java.lang.Exception
Wagon.getFileList(String) when the directory does not exist.java.lang.Exceptionpublic void testWagonResourceExists()
throws java.lang.Exception
java.lang.Exceptionpublic void testWagonResourceNotExists()
throws java.lang.Exception
java.lang.Exceptionprotected void putFile(java.lang.String resourceName,
java.lang.String testFileName,
java.lang.String content)
throws java.lang.Exception
java.lang.Exceptionprotected 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.Exceptionprotected void getFile(int expectedSize)
throws java.lang.Exception
java.lang.Exceptionprotected void verifyMock(org.apache.maven.wagon.WagonTestCase.ProgressArgumentMatcher progressArgumentMatcher,
int length)
protected void disconnectWagon(Wagon wagon) throws ConnectionException
ConnectionExceptionprotected 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.Exceptionprotected Repository createFileRepository(java.lang.String url)
Copyright © 2003-2013. All Rights Reserved.