Class ScmTckTestCase
java.lang.Object
org.apache.maven.scm.PlexusJUnit4TestCase
org.apache.maven.scm.ScmTestCase
org.apache.maven.scm.ScmTckTestCase
- Direct Known Subclasses:
AbstractRemoteInfoCommandTckTest, BlameCommandTckTest, BranchCommandTckTest, ChangeLogCommandTckTest, CheckInCommandTckTest, CheckOutCommandTckTest, DiffCommandTckTest, InfoCommandTckTest, ListCommandTckTest, MkdirCommandTckTest, RemoveCommandTckTest, StatusCommandTckTest, TagCommandTckTest, UntagCommandTckTest, UpdateCommandTckTest
Base class for all TcK tests.
Basically all it does is to set up a default test enviroment common for all tck tests. The default setup includes:
- Delete all default locations (working copy, updating copy etc)
- Initialize the repository
- Check out the repository to the working copy
-
Field Summary
FieldsFields inherited from class ScmTestCase
GMT_TIME_ZONEFields inherited from class PlexusJUnit4TestCase
testName -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddToWorkingTree(File workingDirectory, File file, ScmRepository repository) Convenience method to add a file to the working tree at the working directory.protected CheckInScmResultcheckIn(File workingDirectory, ScmRepository repository) Convenience method to check in files to the repository.protected CheckOutScmResultcheckOut(File workingDirectory, ScmRepository repository) Convenience method to check out files from the repository.voidprotected EditScmResultedit(File basedir, String includes, String excludes, ScmRepository repository) Get the list of file names that is supposed to be in the test repo.Some tests can only run if the appropriate application has been installed.protected ScmRepositoryConvenience method to get the ScmRepository for this provider.abstract Stringabstract voidinitRepo()Initialize repository at thegetScmUrl()location with the files ingetScmFileNames()mapFilesByPath(List<ScmFile> files) Take the files of the given list, add them to a TreeMap and use the pathName String as key for the Map.protected RemoveScmResultremove(File workingDirectory, ScmRepository repository) Convenience method to remove files from the repository.voidThis method is available to those SCM clients that need to perform a cleanup at the end of the tests.voidsetUp()voidtearDown()Provided to allow removeRepo() to be called.Methods inherited from class ScmTestCase
assertCommandLine, assertFile, assertPath, assertResultIsSuccess, checkSystemCmdPresence, customizeContainerConfiguration, deleteDirectory, execute, getAssertionCopy, getDate, getDate, getDate, getRepository, getRepositoryRoot, getScmFileSet, getScmManager, getUpdatingCopy, getWorkingCopy, getWorkingDirectory, isSystemCmd, makeDirectory, makeFile, makeFile, makeScmRepository, printOutputError, setDebugExecuteMethods inherited from class PlexusJUnit4TestCase
customizeComponentConfiguration, customizeContext, getBasedir, getClassLoader, getConfiguration, getConfiguration, getConfigurationName, getContainer, getCustomConfigurationName, getCustomModules, getName, getResourceAsStream, getTestConfiguration, getTestConfiguration, getTestFile, getTestFile, getTestPath, getTestPath, lookup, lookup, lookup, lookup, lookupMap, release, setupContainer
-
Field Details
-
scmRepository
-
scmFileNames
-
-
Constructor Details
-
ScmTckTestCase
public ScmTckTestCase()
-
-
Method Details
-
getScmProviderCommand
Some tests can only run if the appropriate application has been installed. If the provided name is not a runnable application all tests in the class are skipped.- Returns:
- the commandline command for the specific scm provider. Or null if none is needed.
-
getScmUrl
-
getScmFileNames
-
initRepo
Initialize repository at the
getScmUrl()location with the files ingetScmFileNames()The setup is also asserting on the existence of these files.
Note: 'svnadmin' should be a system command.
This should only be used by this class (thus do not call this method from derived classes)- Throws:
Exception- if any
-
checkScmPresence
public void checkScmPresence() -
setUp
- Overrides:
setUpin classScmTestCase- Throws:
Exception
-
removeRepo
-
tearDown
Provided to allow removeRepo() to be called.- Overrides:
tearDownin classPlexusJUnit4TestCase- Throws:
Exception
-
getScmRepository
Convenience method to get the ScmRepository for this provider.- Throws:
Exception
-
checkOut
protected CheckOutScmResult checkOut(File workingDirectory, ScmRepository repository) throws Exception Convenience method to check out files from the repository.- Throws:
Exception
-
checkIn
protected CheckInScmResult checkIn(File workingDirectory, ScmRepository repository) throws Exception Convenience method to check in files to the repository.- Throws:
Exception
-
remove
Convenience method to remove files from the repository.- Throws:
Exception
-
addToWorkingTree
protected void addToWorkingTree(File workingDirectory, File file, ScmRepository repository) throws Exception Convenience method to add a file to the working tree at the working directory.- Throws:
Exception
-
mapFilesByPath
Take the files of the given list, add them to a TreeMap and use the pathName String as key for the Map. This function is useful for every TCK which has to check for the existence of more than 1 file of the returned ScmResult, regardless of their order in the list. All backslashes in the path will be replaced by forward slashes for Windows compatibility.- Parameters:
files- list withScmFiles- Returns:
- map key=pathName, value=ScmFile
-
edit
protected EditScmResult edit(File basedir, String includes, String excludes, ScmRepository repository) throws Exception - Throws:
Exception
-