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 TypeMethodDescriptionvoidvoidprotected PlexusConfigurationprotected voidcustomizeContainerConfiguration(ContainerConfiguration containerConfiguration) Allow custom test case implementations do augment the default container configuration before executing tests.protected voidcustomizeContext(Context context) static Stringprotected ClassLoaderprotected InputStreamprotected 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 PlexusContainerprotected Stringprotected InputStreamgetResourceAsStream(String resource) 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> Tprotected <T> Tprotected Objectprotected Objectprotected voidprotected 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
-