Package org.codehaus.plexus
Class PlexusJUnit4TestCase
java.lang.Object
org.codehaus.plexus.PlexusJUnit4TestCase
- Author:
- Jason van Zyl, Trygve Laugstøl, Michal Maczka
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
protected PlexusConfiguration
protected void
customizeContainerConfiguration
(ContainerConfiguration containerConfiguration) Allow custom test case implementations do augment the default container configuration before executing tests.protected void
customizeContext
(Context context) static String
protected ClassLoader
protected InputStream
protected InputStream
getConfiguration
(String subname) protected String
getConfigurationName
(String subname) Allow the retrieval of a container configuration that is based on the name of the test class being run.protected PlexusContainer
protected String
protected InputStream
getResourceAsStream
(String resource) static String
getTestConfiguration
(Class<?> clazz) static File
getTestFile
(String path) static File
getTestFile
(String basedir, String path) static String
getTestPath
(String path) static String
getTestPath
(String basedir, String path) protected <T> T
protected <T> T
protected Object
protected Object
protected void
protected void
-
Constructor Details
-
PlexusJUnit4TestCase
public PlexusJUnit4TestCase()
-
-
Method Details
-
beforeTest
- Throws:
Exception
-
setupContainer
protected void setupContainer() -
customizeContainerConfiguration
Allow custom test case implementations do augment the default container configuration before executing tests.- Parameters:
containerConfiguration
- The configuration
-
customizeContext
-
customizeComponentConfiguration
-
afterTest
- Throws:
Exception
-
getContainer
-
getConfiguration
-
getConfiguration
-
getCustomConfigurationName
-
getConfigurationName
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 (not used)- Returns:
- A configuration name
-
getResourceAsStream
-
getClassLoader
-
lookup
-
lookup
- Throws:
ComponentLookupRuntimeException
-
lookup
- Throws:
ComponentLookupRuntimeException
-
lookup
protected <T> T lookup(Class<T> componentClass, String roleHint) throws ComponentLookupRuntimeException - Throws:
ComponentLookupRuntimeException
-
release
- Throws:
Exception
-
getTestFile
-
getTestFile
-
getTestPath
-
getTestPath
-
getBasedir
-
getTestConfiguration
-
getTestConfiguration
-