public abstract class ScmTestCase extends PlexusJUnit4TestCase
Modifier and Type | Field and Description |
---|---|
protected static TimeZone |
GMT_TIME_ZONE |
testName
Constructor and Description |
---|
ScmTestCase() |
Modifier and Type | Method and Description |
---|---|
void |
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) |
static void |
checkScmPresence(String scmProviderCommand) |
void |
customizeContainerConfiguration(org.codehaus.plexus.ContainerConfiguration configuration)
Allow custom test case implementations do augment the default container configuration before executing tests.
|
protected void |
deleteDirectory(File directory) |
static void |
execute(File workingDirectory,
String executable,
String arguments)
Execute the command line
|
protected File |
getAssertionCopy() |
static Date |
getDate(int year,
int month,
int day) |
protected static Date |
getDate(int year,
int month,
int day,
int hourOfDay,
int minute,
int second,
TimeZone tz) |
protected static Date |
getDate(int year,
int month,
int day,
TimeZone tz) |
protected File |
getRepository() |
protected File |
getRepositoryRoot() |
protected ScmFileSet |
getScmFileSet() |
protected ScmManager |
getScmManager() |
protected File |
getUpdatingCopy() |
protected File |
getWorkingCopy() |
protected File |
getWorkingDirectory()
Legacy method - same as getWorkingCopy()
|
static boolean |
isSystemCmd(String cmd) |
protected static void |
makeDirectory(File basedir,
String fileName) |
protected static void |
makeFile(File basedir,
String fileName) |
static void |
makeFile(File basedir,
String fileName,
String contents) |
protected ScmRepository |
makeScmRepository(String scmUrl) |
protected void |
printOutputError(ScmResult result) |
protected static void |
setDebugExecute(boolean debugExecute) |
void |
setUp() |
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
protected static final TimeZone GMT_TIME_ZONE
public ScmTestCase()
public void setUp() throws Exception
setUp
in class PlexusJUnit4TestCase
Exception
public void customizeContainerConfiguration(org.codehaus.plexus.ContainerConfiguration configuration)
PlexusJUnit4TestCase
customizeContainerConfiguration
in class PlexusJUnit4TestCase
protected File getRepositoryRoot()
protected File getRepository()
protected File getWorkingCopy()
protected File getWorkingDirectory()
protected File getAssertionCopy()
protected File getUpdatingCopy()
protected ScmManager getScmManager() throws Exception
Exception
protected ScmRepository makeScmRepository(String scmUrl) throws Exception
Exception
public void assertPath(String expectedPath, String actualPath) throws Exception
Exception
protected void assertFile(File root, String fileName) throws Exception
Exception
protected void assertResultIsSuccess(ScmResult result)
protected void printOutputError(ScmResult result)
protected ScmFileSet getScmFileSet()
protected static void setDebugExecute(boolean debugExecute)
public static void execute(File workingDirectory, String executable, String arguments) throws Exception
workingDirectory
- not nullexecutable
- not null, should be a system commandarguments
- not nullException
- if anyCommandLineUtils.executeCommandLine(Commandline, org.codehaus.plexus.util.cli.StreamConsumer,
org.codehaus.plexus.util.cli.StreamConsumer)
protected static void makeDirectory(File basedir, String fileName)
protected static void makeFile(File basedir, String fileName) throws IOException
IOException
public static void makeFile(File basedir, String fileName, String contents) throws IOException
IOException
protected void deleteDirectory(File directory) throws IOException
IOException
protected static Date getDate(int year, int month, int day, int hourOfDay, int minute, int second, TimeZone tz)
public void assertCommandLine(String expectedCommand, File expectedWorkingDirectory, org.codehaus.plexus.util.cli.Commandline actualCommand) throws IOException
IOException
public static void checkScmPresence(String scmProviderCommand)
public static boolean isSystemCmd(String cmd)
cmd
- the executable to run, not null.Copyright © 2003–2024 The Apache Software Foundation. All rights reserved.