Package org.apache.maven.scm
Class PlexusJUnit4TestCase
- java.lang.Object
- 
- org.apache.maven.scm.PlexusJUnit4TestCase
 
- 
- Direct Known Subclasses:
- ScmTestCase
 
 public class PlexusJUnit4TestCase extends Object Based on PlexusTestCase from org.sonatype.sisu:sisu-inject-plexus. Note: this class is copied from maven-release.- Author:
- Robert Scholte
 
- 
- 
Field SummaryFields Modifier and Type Field Description org.junit.rules.TestNametestName
 - 
Constructor SummaryConstructors Constructor Description PlexusJUnit4TestCase()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.codehaus.plexus.configuration.PlexusConfigurationcustomizeComponentConfiguration()protected voidcustomizeContainerConfiguration(org.codehaus.plexus.ContainerConfiguration containerConfiguration)Allow custom test case implementations do augment the default container configuration before executing tests.protected voidcustomizeContext(org.codehaus.plexus.context.Context context)static StringgetBasedir()protected ClassLoadergetClassLoader()protected InputStreamgetConfiguration()protected InputStreamgetConfiguration(String subname)protected StringgetConfigurationName(String subname)Allow the retrieval of a container configuration that is based on the name of the test class being run.protected org.codehaus.plexus.PlexusContainergetContainer()protected StringgetCustomConfigurationName()com.google.inject.Module[]getCustomModules()Allows test to define custom modules.StringgetName()protected InputStreamgetResourceAsStream(String resource)StringgetTestConfiguration()static StringgetTestConfiguration(Class<?> clazz)static FilegetTestFile(String path)static FilegetTestFile(String basedir, String path)static StringgetTestPath(String path)static StringgetTestPath(String basedir, String path)protected <T> Tlookup(Class<T> componentClass)protected <T> Tlookup(Class<T> componentClass, String roleHint)protected Objectlookup(String componentKey)protected Objectlookup(String role, String roleHint)protected <T> Map<String,T>lookupMap(Class<T> componentClass)protected voidrelease(Object component)voidsetUp()protected voidsetupContainer()voidtearDown()
 
- 
- 
- 
Field Detail- 
testNamepublic org.junit.rules.TestName testName 
 
- 
 - 
Constructor Detail- 
PlexusJUnit4TestCasepublic PlexusJUnit4TestCase() 
 
- 
 - 
Method Detail- 
setupContainerprotected void setupContainer() 
 - 
getCustomModulespublic com.google.inject.Module[] getCustomModules() Allows test to define custom modules.
 - 
customizeContainerConfigurationprotected void customizeContainerConfiguration(org.codehaus.plexus.ContainerConfiguration containerConfiguration) Allow custom test case implementations do augment the default container configuration before executing tests.- Parameters:
- containerConfiguration-
 
 - 
customizeContextprotected void customizeContext(org.codehaus.plexus.context.Context context) 
 - 
customizeComponentConfigurationprotected org.codehaus.plexus.configuration.PlexusConfiguration customizeComponentConfiguration() 
 - 
getContainerprotected org.codehaus.plexus.PlexusContainer getContainer() 
 - 
getConfigurationprotected InputStream getConfiguration() throws Exception - Throws:
- Exception
 
 - 
getConfigurationprotected InputStream getConfiguration(String subname) throws Exception - Throws:
- Exception
 
 - 
getCustomConfigurationNameprotected String getCustomConfigurationName() 
 - 
getConfigurationNameprotected String getConfigurationName(String subname) Allow the retrieval of a container configuration that is based on the name of the test class being run. So if you have a test class called org.foo.FunTest, then this will produce a resource name of org/foo/FunTest.xml which would be used to configure the Plexus container before running your test.- Parameters:
- subname-
- Returns:
 
 - 
getResourceAsStreamprotected InputStream getResourceAsStream(String resource) 
 - 
getClassLoaderprotected ClassLoader getClassLoader() 
 - 
lookupprotected <T> T lookup(Class<T> componentClass, String roleHint) throws Exception - Throws:
- Exception
 
 - 
lookupMapprotected <T> Map<String,T> lookupMap(Class<T> componentClass) throws Exception - Throws:
- Exception
 
 - 
getTestFilepublic static File getTestFile(String path) 
 - 
getTestFilepublic static File getTestFile(String basedir, String path) 
 - 
getTestPathpublic static String getTestPath(String path) 
 - 
getTestPathpublic static String getTestPath(String basedir, String path) 
 - 
getBasedirpublic static String getBasedir() 
 - 
getTestConfigurationpublic String getTestConfiguration() 
 - 
getTestConfigurationpublic static String getTestConfiguration(Class<?> clazz) 
 
- 
 
-