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 -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 <T> T
protected <T> T
protected void
protected void
setUp()
protected void
protected void
tearDown()
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
-
Constructor Details
-
PlexusTestCase
public PlexusTestCase()
-
-
Method Details
-
setUp
- Overrides:
setUp
in classjunit.framework.TestCase
- Throws:
Exception
-
setupContainer
protected void setupContainer() -
customizeContainerConfiguration
Allow custom test case implementations do augment the default container configuration before executing tests.- Parameters:
containerConfiguration
-ContainerConfiguration
.
-
customizeContext
-
customizeComponentConfiguration
-
tearDown
- Overrides:
tearDown
in classjunit.framework.TestCase
- Throws:
Exception
-
getContainer
-
getConfiguration
- Throws:
Exception
-
getConfiguration
- Throws:
Exception
-
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- Returns:
- A configruation name
-
getResourceAsStream
-
getClassLoader
-
lookup
- Throws:
Exception
-
lookup
- Throws:
Exception
-
lookup
- Throws:
Exception
-
lookup
- Throws:
Exception
-
release
- Throws:
Exception
-
getTestFile
-
getTestFile
-
getTestPath
-
getTestPath
-
getBasedir
-
getTestConfiguration
-
getTestConfiguration
-