Class 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 Detail

      • PlexusTestCase

        public PlexusTestCase()
    • Method Detail

      • setUp

        protected void setUp()
                      throws Exception
        Overrides:
        setUp in class junit.framework.TestCase
        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 - ContainerConfiguration.
      • customizeContext

        protected void customizeContext​(Context context)
      • customizeComponentConfiguration

        protected PlexusConfiguration customizeComponentConfiguration()
      • tearDown

        protected void tearDown()
                         throws Exception
        Overrides:
        tearDown in class junit.framework.TestCase
        Throws:
        Exception
      • 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 - the subname
        Returns:
        A configruation name
      • getResourceAsStream

        protected InputStream getResourceAsStream​(String resource)
      • getClassLoader

        protected ClassLoader getClassLoader()
      • getTestFile

        public static File getTestFile​(String path)
      • getTestFile

        public static File getTestFile​(String basedir,
                                       String path)
      • getTestPath

        public static String getTestPath​(String path)
      • getBasedir

        public static String getBasedir()
      • getTestConfiguration

        public String getTestConfiguration()
      • getTestConfiguration

        public static String getTestConfiguration​(Class<?> clazz)