Package org.apache.maven.scm
Class ScmTestCase
java.lang.Object
org.apache.maven.scm.PlexusJUnit4TestSupport
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.
- Author:
- Jason van Zyl
-
Field Summary
FieldsFields inherited from class org.apache.maven.scm.PlexusJUnit4TestSupport
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 voidcheckScmPresence(String scmProviderCommand) protected 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 lineprotected 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) static voidprintSystemCmdUnavail(String cmd, String testName) protected static voidsetDebugExecute(boolean debugExecute) voidsetUp()Methods inherited from class org.apache.maven.scm.PlexusJUnit4TestSupport
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
-
-
Constructor Details
-
ScmTestCase
public ScmTestCase()
-
-
Method Details
-
setUp
- Overrides:
setUpin classPlexusJUnit4TestSupport- Throws:
Exception
-
customizeContainerConfiguration
protected void customizeContainerConfiguration(org.codehaus.plexus.ContainerConfiguration configuration) Description copied from class:PlexusJUnit4TestSupportAllow custom test case implementations do augment the default container configuration before executing tests.- Overrides:
customizeContainerConfigurationin classPlexusJUnit4TestSupport
-
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
- Throws:
Exception
-
assertFile
- Throws:
Exception
-
assertResultIsSuccess
-
printOutputError
-
getScmFileSet
-
setDebugExecute
-
execute
public static void execute(File workingDirectory, String executable, String arguments) throws Exception Execute the command line- Parameters:
workingDirectory- not nullexecutable- not null, should be a system commandarguments- not null- Throws:
Exception- if any- See Also:
-
CommandLineUtils.executeCommandLine(Commandline, org.codehaus.plexus.util.cli.StreamConsumer, org.codehaus.plexus.util.cli.StreamConsumer)
-
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
-
checkScmPresence
-
isSystemCmd
- Parameters:
cmd- the executable to run, not null.- Returns:
- true if and only if the command is on the path
-