Class ScmTestCase
java.lang.Object
org.apache.maven.scm.PlexusJUnit4TestCase
org.apache.maven.scm.ScmTestCase
- Direct Known Subclasses:
ScmTckTestCase
Base class for all SCM tests. Consumers will typically
extend this class while tck test would extend ScmTckTestCase.
This class basically defines default locations for the test environment and implements convenience methods.
This class basically defines default locations for the test environment and implements convenience methods.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static booleanprotected static final TimeZoneprivate ScmManagerFields inherited from class PlexusJUnit4TestCase
testName -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidassertCommandLine(String expectedCommand, File expectedWorkingDirectory, org.codehaus.plexus.util.cli.Commandline actualCommand) protected voidassertFile(File root, String fileName) voidassertPath(String expectedPath, String actualPath) protected voidassertResultIsSuccess(ScmResult result) static voidcheckSystemCmdPresence(String scmProviderCommand) voidcustomizeContainerConfiguration(org.codehaus.plexus.ContainerConfiguration configuration) Allow custom test case implementations do augment the default container configuration before executing tests.protected voiddeleteDirectory(File directory) static voidExecute the command line.protected Filestatic DategetDate(int year, int month, int day) protected static Dateprotected static Dateprotected Fileprotected Fileprotected ScmFileSetprotected ScmManagerprotected Fileprotected Fileprotected FileLegacy method - same as getWorkingCopy()static booleanisSystemCmd(String cmd) protected static voidmakeDirectory(File basedir, String fileName) protected static voidstatic voidprotected ScmRepositorymakeScmRepository(String scmUrl) protected voidprintOutputError(ScmResult result) protected static voidsetDebugExecute(boolean debugExecute) voidsetUp()Methods 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, tearDown
-
Field Details
-
GMT_TIME_ZONE
-
debugExecute
private static boolean debugExecute -
scmManager
-
-
Constructor Details
-
ScmTestCase
public ScmTestCase()
-
-
Method Details
-
setUp
- Overrides:
setUpin classPlexusJUnit4TestCase- Throws:
Exception
-
customizeContainerConfiguration
public void customizeContainerConfiguration(org.codehaus.plexus.ContainerConfiguration configuration) Description copied from class:PlexusJUnit4TestCaseAllow custom test case implementations do augment the default container configuration before executing tests.- Overrides:
customizeContainerConfigurationin classPlexusJUnit4TestCase- Parameters:
configuration-
-
getRepositoryRoot
- Returns:
- default location of the test read/write repository
-
getRepository
- Returns:
- location of the revisioned (read only) repository
-
getWorkingCopy
- Returns:
- location of the working copy (always checkout)
-
getWorkingDirectory
Legacy method - same as getWorkingCopy()- Returns:
- location of the working copy (always checkout)
-
getAssertionCopy
- Returns:
- default location for doing assertions on a working tree
-
getUpdatingCopy
- Returns:
- default location for doing update operations on a working tree
-
getScmManager
- Throws:
Exception
-
makeScmRepository
- Throws:
Exception
-
assertPath
-
assertFile
-
assertResultIsSuccess
-
printOutputError
-
getScmFileSet
-
setDebugExecute
protected static void setDebugExecute(boolean debugExecute) -
execute
-
makeDirectory
-
makeFile
- Throws:
IOException
-
makeFile
- Throws:
IOException
-
deleteDirectory
- Throws:
IOException
-
getDate
-
getDate
-
getDate
-
assertCommandLine
public void assertCommandLine(String expectedCommand, File expectedWorkingDirectory, org.codehaus.plexus.util.cli.Commandline actualCommand) throws IOException - Throws:
IOException
-
checkSystemCmdPresence
-
isSystemCmd
- Parameters:
cmd- the executable to run, not null- Returns:
- true if and only if the command is on the path
-