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
- Version:
- $Id: PlexusTestCase.java 8105 2009-02-10 23:50:53Z jvanzyl $
- Author:
- Jason van Zyl, Trygve Laugstøl, Michal Maczka
Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString |
Methods inherited from class junit.framework.Assert |
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, fail, fail, failNotEquals, failNotSame, failSame |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PlexusTestCase
public PlexusTestCase()
setUp
protected void setUp()
throws java.lang.Exception
- Overrides:
setUp
in class junit.framework.TestCase
- Throws:
java.lang.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
-
customizeContext
protected void customizeContext(Context context)
customizeComponentConfiguration
protected PlexusConfiguration customizeComponentConfiguration()
tearDown
protected void tearDown()
throws java.lang.Exception
- Overrides:
tearDown
in class junit.framework.TestCase
- Throws:
java.lang.Exception
getContainer
protected PlexusContainer getContainer()
getConfiguration
protected java.io.InputStream getConfiguration()
throws java.lang.Exception
- Throws:
java.lang.Exception
getConfiguration
protected java.io.InputStream getConfiguration(java.lang.String subname)
throws java.lang.Exception
- Throws:
java.lang.Exception
getCustomConfigurationName
protected java.lang.String getCustomConfigurationName()
getConfigurationName
protected java.lang.String getConfigurationName(java.lang.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:
getResourceAsStream
protected java.io.InputStream getResourceAsStream(java.lang.String resource)
getClassLoader
protected java.lang.ClassLoader getClassLoader()
lookup
protected java.lang.Object lookup(java.lang.String componentKey)
throws java.lang.Exception
- Throws:
java.lang.Exception
lookup
protected java.lang.Object lookup(java.lang.String role,
java.lang.String roleHint)
throws java.lang.Exception
- Throws:
java.lang.Exception
lookup
protected <T> T lookup(java.lang.Class<T> componentClass)
throws java.lang.Exception
- Throws:
java.lang.Exception
lookup
protected <T> T lookup(java.lang.Class<T> componentClass,
java.lang.String roleHint)
throws java.lang.Exception
- Throws:
java.lang.Exception
release
protected void release(java.lang.Object component)
throws java.lang.Exception
- Throws:
java.lang.Exception
getTestFile
public static java.io.File getTestFile(java.lang.String path)
getTestFile
public static java.io.File getTestFile(java.lang.String basedir,
java.lang.String path)
getTestPath
public static java.lang.String getTestPath(java.lang.String path)
getTestPath
public static java.lang.String getTestPath(java.lang.String basedir,
java.lang.String path)
getBasedir
public static java.lang.String getBasedir()
getTestConfiguration
public java.lang.String getTestConfiguration()
getTestConfiguration
public static java.lang.String getTestConfiguration(java.lang.Class<?> clazz)
Copyright © 2001-2009 Codehaus. All Rights Reserved.