org.apache.maven.wagon

Class WagonTestCase

public abstract class WagonTestCase extends PlexusTestCase

Version: $Id: WagonTestCase.java 477175 2006-11-20 13:50:29Z brett $

Author: Jason van Zyl

Field Summary
protected FileartifactDestFile
protected FileartifactSourceFile
protected ChecksumObserverchecksumObserver
protected FiledestFile
protected RepositorylocalRepository
protected StringlocalRepositoryPath
protected static StringPOM
protected Stringresource
protected FilesourceFile
protected RepositorytestRepository
Method Summary
protected voidassertNotExists(Wagon wagon, String resourceName)
Assert that a resource does not exist in the remote wagon system
protected voidassertResourcesAreInRemoteSide(Wagon wagon, List resourceNames)
protected voidcreateDirectory(Wagon wagon, String resourceToCreate, String dirName)
Create a directory with a resource and check that the other ones don't exist
protected RepositorycreateFileRepository(String url)
protected voidcustomizeContext()
protected voidfileRoundTripTesting()
protected AuthenticationInfogetAuthInfo()
protected voidgetFile()
protected RepositoryPermissionsgetPermissions()
protected abstract StringgetProtocol()
Protocol id of the Wagon to use, eg.
protected abstract StringgetTestRepositoryUrl()
URL of the repository.
protected WagongetWagon()
voidmessage(String message)
protected voidputFile(String resourceName, String testFileName, String content)
protected voidputFile()
protected voidsetupRepositories()
protected voidsetupWagonTestingFixtures()
protected voidsetUp()
protected voidtearDownWagonTestingFixtures()
voidtestFailedGet()
voidtestWagon()
voidtestWagonGetFileList()
Test Wagon#getFileList(String).
voidtestWagonGetFileListWhenDirectoryDoesNotExist()
Test Wagon#getFileList(String) when the directory does not exist.
voidtestWagonPutDirectory()
voidtestWagonPutDirectoryDeepDestination()
Test for putting a directory with a destination that multiple directories deep, all of which haven't been created.
voidtestWagonPutDirectoryWhenDirectoryAlreadyExists()
Test that when putting a directory that already exists new files get also copied
voidtestWagonResourceExists()
Test for an existing resource.
voidtestWagonResourceNotExists()
Test for an invalid resource.
voidwriteTestFile(String child)

Field Detail

artifactDestFile

protected File artifactDestFile

artifactSourceFile

protected File artifactSourceFile

checksumObserver

protected ChecksumObserver checksumObserver

destFile

protected File destFile

localRepository

protected Repository localRepository

localRepositoryPath

protected String localRepositoryPath

POM

protected static String POM

resource

protected String resource

sourceFile

protected File sourceFile

testRepository

protected Repository testRepository

Method Detail

assertNotExists

protected void assertNotExists(Wagon wagon, String resourceName)
Assert that a resource does not exist in the remote wagon system

Parameters: wagon wagon to get the resource from resourceName name of the resource

Throws: IOException if a temp file can't be created AuthorizationException TransferFailedException

Since: 1.0-beta-1

assertResourcesAreInRemoteSide

protected void assertResourcesAreInRemoteSide(Wagon wagon, List resourceNames)

createDirectory

protected void createDirectory(Wagon wagon, String resourceToCreate, String dirName)
Create a directory with a resource and check that the other ones don't exist

Parameters: wagon resourceToCreate name of the resource to be created dirName directory name to create

Throws: Exception

createFileRepository

protected Repository createFileRepository(String url)

customizeContext

protected void customizeContext()

fileRoundTripTesting

protected void fileRoundTripTesting()

getAuthInfo

protected AuthenticationInfo getAuthInfo()

getFile

protected void getFile()

getPermissions

protected RepositoryPermissions getPermissions()

getProtocol

protected abstract String getProtocol()
Protocol id of the Wagon to use, eg. scp, ftp

Returns: the protocol id

getTestRepositoryUrl

protected abstract String getTestRepositoryUrl()
URL of the repository. For a complete test it should point to a non existing folder so we also check for the creation of new folders in the remote site.

return the URL of the repository as specified by Wagon syntax

getWagon

protected Wagon getWagon()

message

private void message(String message)

putFile

protected void putFile(String resourceName, String testFileName, String content)

putFile

protected void putFile()

setupRepositories

protected void setupRepositories()

setupWagonTestingFixtures

protected void setupWagonTestingFixtures()

setUp

protected void setUp()

tearDownWagonTestingFixtures

protected void tearDownWagonTestingFixtures()

testFailedGet

public void testFailedGet()

testWagon

public void testWagon()

testWagonGetFileList

public void testWagonGetFileList()
Test Wagon#getFileList(String).

Throws: Exception

Since: 1.0-beta-2

testWagonGetFileListWhenDirectoryDoesNotExist

public void testWagonGetFileListWhenDirectoryDoesNotExist()
Test Wagon#getFileList(String) when the directory does not exist.

Throws: Exception

Since: 1.0-beta-2

testWagonPutDirectory

public void testWagonPutDirectory()

testWagonPutDirectoryDeepDestination

public void testWagonPutDirectoryDeepDestination()
Test for putting a directory with a destination that multiple directories deep, all of which haven't been created.

Throws: Exception

Since: 1.0-beta-2

testWagonPutDirectoryWhenDirectoryAlreadyExists

public void testWagonPutDirectoryWhenDirectoryAlreadyExists()
Test that when putting a directory that already exists new files get also copied

Throws: Exception

Since: 1.0-beta-1

testWagonResourceExists

public void testWagonResourceExists()
Test for an existing resource.

Throws: Exception

Since: 1.0-beta-2

testWagonResourceNotExists

public void testWagonResourceNotExists()
Test for an invalid resource.

Throws: Exception

Since: 1.0-beta-2

writeTestFile

private void writeTestFile(String child)