Class PlexusJUnit4TestSupport

java.lang.Object
org.apache.maven.scm.PlexusJUnit4TestSupport
Direct Known Subclasses:
ScmTestCase

public abstract class PlexusJUnit4TestSupport extends Object
Based on PlexusTestCase from org.sonatype.sisu:sisu-inject-plexus. Note: this class is copied from maven-release.
Author:
Robert Scholte
  • Field Details

    • testName

      public org.junit.rules.TestName testName
  • Constructor Details

    • PlexusJUnit4TestSupport

      public PlexusJUnit4TestSupport()
  • Method Details

    • setUp

      public void setUp() throws Exception
      Throws:
      Exception
    • getName

      protected String getName()
    • setupContainer

      protected void setupContainer()
    • getCustomModules

      protected com.google.inject.Module[] getCustomModules()
      Allows test to define custom modules.
    • customizeContainerConfiguration

      protected void customizeContainerConfiguration(org.codehaus.plexus.ContainerConfiguration containerConfiguration)
      Allow custom test case implementations do augment the default container configuration before executing tests.
      Parameters:
      containerConfiguration -
    • customizeContext

      protected void customizeContext(org.codehaus.plexus.context.Context context)
    • customizeComponentConfiguration

      protected org.codehaus.plexus.configuration.PlexusConfiguration customizeComponentConfiguration()
    • tearDown

      public void tearDown() throws Exception
      Throws:
      Exception
    • getContainer

      protected org.codehaus.plexus.PlexusContainer getContainer()
    • getConfiguration

      protected InputStream getConfiguration() throws Exception
      Throws:
      Exception
    • getConfiguration

      protected InputStream getConfiguration(String subname) throws Exception
      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 -
      Returns:
    • getResourceAsStream

      protected InputStream getResourceAsStream(String resource)
    • getClassLoader

      protected ClassLoader getClassLoader()
    • lookup

      protected Object lookup(String componentKey) throws Exception
      Throws:
      Exception
    • lookup

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

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

      protected <T> T lookup(Class<T> componentClass, String roleHint) throws Exception
      Throws:
      Exception
    • lookupMap

      protected <T> Map<String,T> lookupMap(Class<T> componentClass) throws Exception
      Throws:
      Exception
    • 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)