Package org.codehaus.plexus
Class PlexusTestCase
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- org.codehaus.plexus.PlexusTestCase
-
- All Implemented Interfaces:
junit.framework.Test
public abstract class PlexusTestCase extends junit.framework.TestCase- Author:
- Jason van Zyl, Trygve Laugstøl, Michal Maczka
-
-
Constructor Summary
Constructors Constructor Description PlexusTestCase()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected PlexusConfigurationcustomizeComponentConfiguration()protected voidcustomizeContainerConfiguration(ContainerConfiguration containerConfiguration)Allow custom test case implementations do augment the default container configuration before executing tests.protected voidcustomizeContext(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 PlexusContainergetContainer()protected StringgetCustomConfigurationName()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 <T> Tlookup(String componentKey)protected <T> Tlookup(String role, String roleHint)protected voidrelease(Object component)protected voidsetUp()protected voidsetupContainer()protected voidtearDown()-
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
-
-
-
-
Method Detail
-
setUp
protected void setUp() throws Exception- Overrides:
setUpin classjunit.framework.TestCase- Throws:
Exception
-
setupContainer
protected void setupContainer()
-
customizeContainerConfiguration
protected void customizeContainerConfiguration(ContainerConfiguration containerConfiguration)
Allow custom test case implementations do augment the default container configuration before executing tests.- Parameters:
containerConfiguration-ContainerConfiguration.
-
customizeContext
protected void customizeContext(Context context)
-
customizeComponentConfiguration
protected PlexusConfiguration customizeComponentConfiguration()
-
tearDown
protected void tearDown() throws Exception- Overrides:
tearDownin classjunit.framework.TestCase- Throws:
Exception
-
getContainer
protected PlexusContainer getContainer()
-
getConfiguration
protected InputStream getConfiguration() throws Exception
- Throws:
Exception
-
getConfiguration
protected InputStream getConfiguration(String subname) throws Exception
- Throws:
Exception
-
getCustomConfigurationName
protected String getCustomConfigurationName()
-
getConfigurationName
protected 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- the subname- Returns:
- A configruation name
-
getResourceAsStream
protected InputStream getResourceAsStream(String resource)
-
getClassLoader
protected ClassLoader getClassLoader()
-
lookup
protected <T> T lookup(Class<T> componentClass, String roleHint) throws Exception
- Throws:
Exception
-
getBasedir
public static String getBasedir()
-
getTestConfiguration
public String getTestConfiguration()
-
-