org.codehaus.plexus
Class PlexusJUnit4TestCase

java.lang.Object
  extended by org.codehaus.plexus.PlexusJUnit4TestCase

public abstract class PlexusJUnit4TestCase
extends Object

Version:
$Id$
Author:
Jason van Zyl, Trygve Laugstøl, Michal Maczka

Constructor Summary
PlexusJUnit4TestCase()
           
 
Method Summary
 void afterTest()
           
 void beforeTest()
           
protected  PlexusConfiguration customizeComponentConfiguration()
           
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 getBasedir()
           
protected  ClassLoader getClassLoader()
           
protected  InputStream getConfiguration()
           
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 getContainer()
           
protected  String getCustomConfigurationName()
           
protected  InputStream getResourceAsStream(String resource)
           
 String getTestConfiguration()
           
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
lookup(Class<T> componentClass)
           
protected
<T> T
lookup(Class<T> componentClass, String roleHint)
           
protected  Object lookup(String componentKey)
           
protected  Object lookup(String role, String roleHint)
           
protected  void release(Object component)
           
protected  void setupContainer()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlexusJUnit4TestCase

public PlexusJUnit4TestCase()
Method Detail

beforeTest

public void beforeTest()
                throws Exception
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 -

customizeContext

protected void customizeContext(Context context)

customizeComponentConfiguration

protected PlexusConfiguration customizeComponentConfiguration()

afterTest

public void afterTest()
               throws Exception
Throws:
Exception

getContainer

protected PlexusContainer getContainer()

getConfiguration

protected InputStream getConfiguration()

getConfiguration

protected InputStream getConfiguration(String subname)

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 -
Returns:

getResourceAsStream

protected InputStream getResourceAsStream(String resource)

getClassLoader

protected ClassLoader getClassLoader()

lookup

protected Object lookup(String componentKey)

lookup

protected Object lookup(String role,
                        String roleHint)
                 throws ComponentLookupRuntimeException
Throws:
ComponentLookupRuntimeException

lookup

protected <T> T lookup(Class<T> componentClass)
            throws ComponentLookupRuntimeException
Throws:
ComponentLookupRuntimeException

lookup

protected <T> T lookup(Class<T> componentClass,
                       String roleHint)
            throws ComponentLookupRuntimeException
Throws:
ComponentLookupRuntimeException

release

protected void release(Object component)
                throws Exception
Throws:
Exception

getTestFile

public static File getTestFile(String path)

getTestFile

public static File getTestFile(String basedir,
                               String path)

getTestPath

public static String getTestPath(String path)

getTestPath

public static String getTestPath(String basedir,
                                 String path)

getBasedir

public static String getBasedir()

getTestConfiguration

public String getTestConfiguration()

getTestConfiguration

public static String getTestConfiguration(Class<?> clazz)


Copyright © 2001–2014 Codehaus. All rights reserved.