public abstract class WagonTestCase extends org.codehaus.plexus.PlexusTestCase
| Modifier and Type | Field and Description |
|---|---|
protected File |
artifactDestFile |
protected File |
artifactSourceFile |
protected ChecksumObserver |
checksumObserver |
protected File |
destFile |
protected Repository |
localRepository |
protected String |
localRepositoryPath |
protected static Logger |
logger |
protected TransferListener |
mockTransferListener |
protected static String |
POM |
protected String |
resource |
protected File |
sourceFile |
protected Repository |
testRepository |
| Constructor and Description |
|---|
WagonTestCase() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertGetIfNewerTest(org.apache.maven.wagon.WagonTestCase.ProgressAnswer progressAnswer,
boolean expectedResult,
int expectedSize) |
protected void |
assertNotExists(Wagon wagon,
String resourceName)
Assert that a resource does not exist in the remote wagon system
|
protected boolean |
assertOnTransferProgress()
some test (mock on transfertprogress call) relies on the fact that InputStream #read(byte[] b, int off, int len)
read all bytes.
|
protected void |
assertResourcesAreInRemoteSide(Wagon wagon,
List<String> resourceNames) |
protected void |
connectWagon(Wagon wagon) |
protected void |
createDirectory(Wagon wagon,
String resourceToCreate,
String dirName)
Create a directory with a resource and check that the other ones don't exist
|
protected Repository |
createFileRepository(String url) |
protected TransferEvent |
createTransferEvent(Wagon wagon,
Resource resource,
int eventType,
int requestType,
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 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 String |
getTestRepositoryUrl()
URL of the repository.
|
protected Wagon |
getWagon() |
protected void |
message(String message) |
protected int |
putFile() |
protected void |
putFile(String resourceName,
String testFileName,
String content) |
protected org.apache.maven.wagon.WagonTestCase.ProgressAnswer |
replaceMockForGet(Wagon wagon,
int expectedSize) |
protected org.apache.maven.wagon.WagonTestCase.ProgressAnswer |
replayMockForPut(String resourceName,
String content,
Wagon wagon) |
protected void |
setUp() |
protected org.apache.maven.wagon.WagonTestCase.ProgressAnswer |
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.ProgressAnswer progressAnswer,
int length) |
customizeComponentConfiguration, customizeContainerConfiguration, customizeContext, getBasedir, getClassLoader, getConfiguration, getConfiguration, getConfigurationName, getContainer, getCustomConfigurationName, getResourceAsStream, getTestConfiguration, getTestConfiguration, getTestFile, getTestFile, getTestPath, getTestPath, lookup, lookup, lookup, lookup, release, setupContainer, tearDowncountTestCases, createResult, getName, run, run, runBare, runTest, setName, toStringassertEquals, 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, formatprotected Repository localRepository
protected Repository testRepository
protected String localRepositoryPath
protected File sourceFile
protected File artifactSourceFile
protected File artifactDestFile
protected ChecksumObserver checksumObserver
protected TransferListener mockTransferListener
public WagonTestCase()
protected void setUp() throws Exception
setUp in class org.codehaus.plexus.PlexusTestCaseExceptionprotected abstract String getTestRepositoryUrl() throws IOException
IOExceptionprotected abstract String getProtocol()
scp, ftpprotected abstract int getTestRepositoryPort()
protected void setupRepositories() throws Exception
Exceptionprotected void customizeContext() throws Exception
Exceptionprotected void setupWagonTestingFixtures() throws Exception
Exceptionprotected void tearDownWagonTestingFixtures() throws Exception
Exceptionprotected AuthenticationInfo getAuthInfo()
protected RepositoryPermissions getPermissions()
public void testWagonGetIfNewerIsNewer() throws Exception
Exceptionprotected boolean supportsGetIfNewer()
public void testWagonGetIfNewerIsSame() throws Exception
Exceptionpublic void testWagonGetIfNewerIsOlder() throws Exception
Exceptionprotected org.apache.maven.wagon.WagonTestCase.ProgressAnswer setupGetIfNewerTest(Wagon wagon, boolean expectedResult, int expectedSize) throws NoSuchAlgorithmException, IOException
NoSuchAlgorithmExceptionIOExceptionprotected void assertGetIfNewerTest(org.apache.maven.wagon.WagonTestCase.ProgressAnswer progressAnswer, boolean expectedResult, int expectedSize) throws IOException
IOExceptionpublic void testWagonPutDirectory() throws Exception
Exceptionpublic void testWagonPutDirectoryDeepDestination() throws Exception
Exceptionpublic void testWagonPutDirectoryWhenDirectoryAlreadyExists() throws Exception
Exceptionpublic void testWagonPutDirectoryForDot() throws Exception
Exceptionprotected void createDirectory(Wagon wagon, String resourceToCreate, String dirName) throws Exception
wagon - resourceToCreate - name of the resource to be createddirName - directory name to createExceptionprotected void assertResourcesAreInRemoteSide(Wagon wagon, List<String> resourceNames) throws IOException, TransferFailedException, ResourceDoesNotExistException, AuthorizationException
protected void assertNotExists(Wagon wagon, String resourceName) throws IOException, TransferFailedException, AuthorizationException
wagon - wagon to get the resource fromresourceName - name of the resourceIOException - if a temp file can't be createdAuthorizationExceptionTransferFailedExceptionpublic void testFailedGet() throws Exception
Exceptionpublic void testFailedGetIfNewer() throws Exception
Exceptionpublic void testWagonGetFileList() throws Exception
Exceptionpublic void testWagonGetFileListWhenDirectoryDoesNotExist() throws Exception
Wagon.getFileList(String) when the directory does not exist.Exceptionpublic void testWagonResourceExists() throws Exception
Exceptionpublic void testWagonResourceNotExists() throws Exception
Exceptionprotected void putFile(String resourceName, String testFileName, String content) throws Exception
Exceptionprotected org.apache.maven.wagon.WagonTestCase.ProgressAnswer replayMockForPut(String resourceName, String content, Wagon wagon)
protected TransferEvent createTransferEvent(Wagon wagon, Resource resource, int eventType, int requestType, File file)
protected void verifyMock(org.apache.maven.wagon.WagonTestCase.ProgressAnswer progressAnswer, int length)
protected void disconnectWagon(Wagon wagon) throws ConnectionException
ConnectionExceptionprotected void connectWagon(Wagon wagon) throws ConnectionException, AuthenticationException
protected boolean assertOnTransferProgress()
protected org.apache.maven.wagon.WagonTestCase.ProgressAnswer replaceMockForGet(Wagon wagon, int expectedSize)
protected int getExpectedContentLengthOnGet(int expectedSize)
protected long getExpectedLastModifiedOnGet(Repository repository, Resource resource)
protected void fileRoundTripTesting() throws Exception
Exceptionprotected Repository createFileRepository(String url)
Copyright © 2003–2013 The Apache Software Foundation. All rights reserved.