Package org.apache.maven.scm
Class ScmTestCase
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.codehaus.plexus.PlexusTestCase
org.apache.maven.scm.ScmTestCase
- All Implemented Interfaces:
junit.framework.Test
- Direct Known Subclasses:
AbstractCvsScmTest
,CvsUpdateCommandTest
,ScmTckTestCase
public abstract class ScmTestCase
extends org.codehaus.plexus.PlexusTestCase
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 boolean
protected static final TimeZone
private ScmManager
private org.sonatype.plexus.components.sec.dispatcher.SecDispatcher
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
assertCommandLine
(String expectedCommand, File expectedWorkingDirectory, org.codehaus.plexus.util.cli.Commandline actualCommand) protected void
assertFile
(File root, String fileName) void
assertPath
(String expectedPath, String actualPath) protected void
assertResultIsSuccess
(ScmResult result) protected void
deleteDirectory
(File directory) static void
Execute the command lineprotected File
static Date
getDate
(int year, int month, int day) protected static Date
protected static Date
protected File
protected File
protected ScmFileSet
protected ScmManager
org.sonatype.plexus.components.sec.dispatcher.SecDispatcher
If you wish to use this component, make sure to configure your TCK implementation to include plexus component configuration as doc at https://issues.apache.org/jira/browse/MNG-4384protected File
protected File
protected File
Legacy method - same as getWorkingCopy()static boolean
isSystemCmd
(String cmd) protected static void
makeDirectory
(File basedir, String fileName) protected static void
static void
protected ScmRepository
makeScmRepository
(String scmUrl) protected void
printOutputError
(ScmResult result) static void
printSystemCmdUnavail
(String cmd, String testName) protected static void
setDebugExecute
(boolean debugExecute) protected void
setUp()
Methods inherited from class org.codehaus.plexus.PlexusTestCase
customizeComponentConfiguration, customizeContainerConfiguration, customizeContext, getBasedir, getClassLoader, getConfiguration, getConfiguration, getConfigurationName, getContainer, getCustomConfigurationName, getResourceAsStream, getTestConfiguration, getTestConfiguration, getTestFile, getTestFile, getTestPath, getTestPath, lookup, lookup, lookup, lookup, release, setupContainer, tearDown
Methods inherited from class junit.framework.TestCase
assertEquals, 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, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toString
-
Field Details
-
GMT_TIME_ZONE
-
debugExecute
private static boolean debugExecute -
scmManager
-
secDispatcher
private org.sonatype.plexus.components.sec.dispatcher.SecDispatcher secDispatcher
-
-
Constructor Details
-
ScmTestCase
public ScmTestCase()
-
-
Method Details
-
setUp
- Overrides:
setUp
in classorg.codehaus.plexus.PlexusTestCase
- Throws:
Exception
-
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
-
getSecDispatcher
public org.sonatype.plexus.components.sec.dispatcher.SecDispatcher getSecDispatcher() throws ExceptionIf you wish to use this component, make sure to configure your TCK implementation to include plexus component configuration as doc at https://issues.apache.org/jira/browse/MNG-4384- Returns:
- SecDispatcher
- Throws:
Exception
-
makeScmRepository
- Throws:
Exception
-
assertPath
- Throws:
Exception
-
assertFile
- Throws:
Exception
-
assertResultIsSuccess
-
printOutputError
-
getScmFileSet
-
setDebugExecute
protected static void setDebugExecute(boolean debugExecute) -
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:
-
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
-
isSystemCmd
- Parameters:
cmd
- the executable to run, not null.- Returns:
- true if and only if the command is on the path
-