Class AbstractMojoTestCase

  • All Implemented Interfaces:
    junit.framework.Test

    @Deprecated
    public abstract class AbstractMojoTestCase
    extends org.codehaus.plexus.PlexusTestCase
    Deprecated.
    As of version 3.4.0, it is advised to work with JUnit5 tests which do not use this class but MojoTest instead.
    Author:
    jesse
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      protected void addGuiceModules​(java.util.List<com.google.inject.Module> modules)
      Deprecated.
       
      protected <T extends org.apache.maven.plugin.Mojo>
      T
      configureMojo​(T mojo, java.lang.String artifactId, java.io.File pom)
      Deprecated.
      Configure the mojo
      protected <T extends org.apache.maven.plugin.Mojo>
      T
      configureMojo​(T mojo, org.codehaus.plexus.configuration.PlexusConfiguration pluginConfiguration)
      Deprecated.
      Configure the mojo with the given plexus configuration
      protected org.codehaus.plexus.configuration.PlexusConfiguration extractPluginConfiguration​(java.lang.String artifactId, java.io.File pom)
      Deprecated.
       
      protected org.codehaus.plexus.configuration.PlexusConfiguration extractPluginConfiguration​(java.lang.String artifactId, org.codehaus.plexus.util.xml.Xpp3Dom pomDom)
      Deprecated.
       
      protected org.codehaus.plexus.PlexusContainer getContainer()
      Deprecated.
       
      protected java.lang.String getPluginDescriptorLocation()
      Deprecated.
       
      protected java.lang.String getPluginDescriptorPath()
      Deprecated.
       
      protected java.io.InputStream getPublicDescriptorStream()
      Deprecated.
       
      protected java.util.Map<java.lang.String,​java.lang.Object> getVariablesAndValuesFromObject​(java.lang.Class<?> clazz, java.lang.Object object)
      Deprecated.
      Convenience method to obtain all variables and values from the mojo (including its superclasses) Note: the values in the map are of type Object so the caller is responsible for casting to desired types.
      protected java.util.Map<java.lang.String,​java.lang.Object> getVariablesAndValuesFromObject​(java.lang.Object object)
      Deprecated.
      Convenience method to obtain all variables and values from the mojo (including its superclasses) Note: the values in the map are of type Object so the caller is responsible for casting to desired types.
      protected <T> T getVariableValueFromObject​(java.lang.Object object, java.lang.String variable)
      Deprecated.
      Convenience method to obtain the value of a variable on a mojo that might not have a getter.
      protected <T extends org.apache.maven.plugin.Mojo>
      T
      lookupConfiguredMojo​(org.apache.maven.execution.MavenSession session, org.apache.maven.plugin.MojoExecution execution)
      Deprecated.
       
      protected <T extends org.apache.maven.plugin.Mojo>
      T
      lookupConfiguredMojo​(org.apache.maven.project.MavenProject project, java.lang.String goal)
      Deprecated.
       
      protected <T extends org.apache.maven.plugin.Mojo>
      T
      lookupEmptyMojo​(java.lang.String goal, java.io.File pom)
      Deprecated.
      Lookup the mojo leveraging the actual subprojects pom
      protected <T extends org.apache.maven.plugin.Mojo>
      T
      lookupEmptyMojo​(java.lang.String goal, java.lang.String pluginPom)
      Deprecated.
      Lookup an empty mojo
      protected <T extends org.apache.maven.plugin.Mojo>
      T
      lookupMojo​(java.lang.String goal, java.io.File pom)
      Deprecated.
      Lookup the mojo leveraging the actual subprojects pom
      protected <T extends org.apache.maven.plugin.Mojo>
      T
      lookupMojo​(java.lang.String goal, java.lang.String pluginPom)
      Deprecated.
      Lookup the mojo leveraging the subproject pom
      protected <T extends org.apache.maven.plugin.Mojo>
      T
      lookupMojo​(java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String goal, org.codehaus.plexus.configuration.PlexusConfiguration pluginConfiguration)
      Deprecated.
      lookup the mojo while we have all of the relavent information
      protected org.apache.maven.execution.MavenSession newMavenSession​(org.apache.maven.project.MavenProject project)
      Deprecated.
       
      protected org.apache.maven.plugin.MojoExecution newMojoExecution​(java.lang.String goal)
      Deprecated.
       
      protected void setUp()
      Deprecated.
       
      protected void setupContainer()
      Deprecated.
       
      protected org.codehaus.plexus.ContainerConfiguration setupContainerConfiguration()
      Deprecated.
       
      protected <T> void setVariableValueToObject​(java.lang.Object object, java.lang.String variable, T value)
      Deprecated.
      Convenience method to set values to variables in objects that don't have setters
      • Methods inherited from class org.codehaus.plexus.PlexusTestCase

        customizeContainerConfiguration, customizeContext, getBasedir, getClassLoader, getConfigurationName, getCustomConfigurationName, getResourceAsStream, getTestConfiguration, getTestConfiguration, getTestFile, getTestFile, getTestPath, getTestPath, lookup, lookup, lookup, lookup, release, tearDown, teardownContainer
      • 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AbstractMojoTestCase

        public AbstractMojoTestCase()
        Deprecated.
    • Method Detail

      • setUp

        protected void setUp()
                      throws java.lang.Exception
        Deprecated.
        Overrides:
        setUp in class org.codehaus.plexus.PlexusTestCase
        Throws:
        java.lang.Exception
      • getPublicDescriptorStream

        protected java.io.InputStream getPublicDescriptorStream()
                                                         throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • getPluginDescriptorPath

        protected java.lang.String getPluginDescriptorPath()
        Deprecated.
      • getPluginDescriptorLocation

        protected java.lang.String getPluginDescriptorLocation()
        Deprecated.
      • setupContainer

        protected void setupContainer()
        Deprecated.
        Overrides:
        setupContainer in class org.codehaus.plexus.PlexusTestCase
      • addGuiceModules

        protected void addGuiceModules​(java.util.List<com.google.inject.Module> modules)
        Deprecated.
        Since:
        3.0.0
      • setupContainerConfiguration

        protected org.codehaus.plexus.ContainerConfiguration setupContainerConfiguration()
        Deprecated.
      • getContainer

        protected org.codehaus.plexus.PlexusContainer getContainer()
        Deprecated.
        Overrides:
        getContainer in class org.codehaus.plexus.PlexusTestCase
      • lookupMojo

        protected <T extends org.apache.maven.plugin.Mojo> T lookupMojo​(java.lang.String goal,
                                                                        java.lang.String pluginPom)
                                                                 throws java.lang.Exception
        Deprecated.
        Lookup the mojo leveraging the subproject pom
        Parameters:
        goal -
        pluginPom -
        Returns:
        a Mojo instance
        Throws:
        java.lang.Exception
      • lookupEmptyMojo

        protected <T extends org.apache.maven.plugin.Mojo> T lookupEmptyMojo​(java.lang.String goal,
                                                                             java.lang.String pluginPom)
                                                                      throws java.lang.Exception
        Deprecated.
        Lookup an empty mojo
        Parameters:
        goal -
        pluginPom -
        Returns:
        a Mojo instance
        Throws:
        java.lang.Exception
      • lookupMojo

        protected <T extends org.apache.maven.plugin.Mojo> T lookupMojo​(java.lang.String goal,
                                                                        java.io.File pom)
                                                                 throws java.lang.Exception
        Deprecated.
        Lookup the mojo leveraging the actual subprojects pom
        Parameters:
        goal -
        pom -
        Returns:
        a Mojo instance
        Throws:
        java.lang.Exception
      • lookupEmptyMojo

        protected <T extends org.apache.maven.plugin.Mojo> T lookupEmptyMojo​(java.lang.String goal,
                                                                             java.io.File pom)
                                                                      throws java.lang.Exception
        Deprecated.
        Lookup the mojo leveraging the actual subprojects pom
        Parameters:
        goal -
        pom -
        Returns:
        a Mojo instance
        Throws:
        java.lang.Exception
      • lookupMojo

        protected <T extends org.apache.maven.plugin.Mojo> T lookupMojo​(java.lang.String groupId,
                                                                        java.lang.String artifactId,
                                                                        java.lang.String version,
                                                                        java.lang.String goal,
                                                                        org.codehaus.plexus.configuration.PlexusConfiguration pluginConfiguration)
                                                                 throws java.lang.Exception
        Deprecated.
        lookup the mojo while we have all of the relavent information
        Parameters:
        groupId -
        artifactId -
        version -
        goal -
        pluginConfiguration -
        Returns:
        a Mojo instance
        Throws:
        java.lang.Exception
      • lookupConfiguredMojo

        protected <T extends org.apache.maven.plugin.Mojo> T lookupConfiguredMojo​(org.apache.maven.project.MavenProject project,
                                                                                  java.lang.String goal)
                                                                           throws java.lang.Exception
        Deprecated.
        Parameters:
        project -
        goal -
        Returns:
        Throws:
        java.lang.Exception
        Since:
        2.0
      • lookupConfiguredMojo

        protected <T extends org.apache.maven.plugin.Mojo> T lookupConfiguredMojo​(org.apache.maven.execution.MavenSession session,
                                                                                  org.apache.maven.plugin.MojoExecution execution)
                                                                           throws java.lang.Exception,
                                                                                  org.codehaus.plexus.component.configurator.ComponentConfigurationException
        Deprecated.
        Parameters:
        session -
        execution -
        Returns:
        Throws:
        java.lang.Exception
        org.codehaus.plexus.component.configurator.ComponentConfigurationException
        Since:
        2.0
      • newMavenSession

        protected org.apache.maven.execution.MavenSession newMavenSession​(org.apache.maven.project.MavenProject project)
        Deprecated.
        Parameters:
        project -
        Returns:
        Since:
        2.0
      • newMojoExecution

        protected org.apache.maven.plugin.MojoExecution newMojoExecution​(java.lang.String goal)
        Deprecated.
        Parameters:
        goal -
        Returns:
        Since:
        2.0
      • extractPluginConfiguration

        protected org.codehaus.plexus.configuration.PlexusConfiguration extractPluginConfiguration​(java.lang.String artifactId,
                                                                                                   java.io.File pom)
                                                                                            throws java.lang.Exception
        Deprecated.
        Parameters:
        artifactId -
        pom -
        Returns:
        the plexus configuration
        Throws:
        java.lang.Exception
      • extractPluginConfiguration

        protected org.codehaus.plexus.configuration.PlexusConfiguration extractPluginConfiguration​(java.lang.String artifactId,
                                                                                                   org.codehaus.plexus.util.xml.Xpp3Dom pomDom)
                                                                                            throws java.lang.Exception
        Deprecated.
        Parameters:
        artifactId -
        pomDom -
        Returns:
        the plexus configuration
        Throws:
        java.lang.Exception
      • configureMojo

        protected <T extends org.apache.maven.plugin.Mojo> T configureMojo​(T mojo,
                                                                           java.lang.String artifactId,
                                                                           java.io.File pom)
                                                                    throws java.lang.Exception
        Deprecated.
        Configure the mojo
        Parameters:
        mojo -
        artifactId -
        pom -
        Returns:
        a Mojo instance
        Throws:
        java.lang.Exception
      • configureMojo

        protected <T extends org.apache.maven.plugin.Mojo> T configureMojo​(T mojo,
                                                                           org.codehaus.plexus.configuration.PlexusConfiguration pluginConfiguration)
                                                                    throws java.lang.Exception
        Deprecated.
        Configure the mojo with the given plexus configuration
        Parameters:
        mojo -
        pluginConfiguration -
        Returns:
        a Mojo instance
        Throws:
        java.lang.Exception
      • getVariableValueFromObject

        protected <T> T getVariableValueFromObject​(java.lang.Object object,
                                                   java.lang.String variable)
                                            throws java.lang.IllegalAccessException
        Deprecated.
        Convenience method to obtain the value of a variable on a mojo that might not have a getter. NOTE: the caller is responsible for casting to to what the desired type is.
        Parameters:
        object -
        variable -
        Returns:
        object value of variable
        Throws:
        java.lang.IllegalArgumentException
        java.lang.IllegalAccessException
      • getVariablesAndValuesFromObject

        protected java.util.Map<java.lang.String,​java.lang.Object> getVariablesAndValuesFromObject​(java.lang.Object object)
                                                                                                  throws java.lang.IllegalAccessException
        Deprecated.
        Convenience method to obtain all variables and values from the mojo (including its superclasses) Note: the values in the map are of type Object so the caller is responsible for casting to desired types.
        Parameters:
        object -
        Returns:
        map of variable names and values
        Throws:
        java.lang.IllegalAccessException
      • getVariablesAndValuesFromObject

        protected java.util.Map<java.lang.String,​java.lang.Object> getVariablesAndValuesFromObject​(java.lang.Class<?> clazz,
                                                                                                         java.lang.Object object)
                                                                                                  throws java.lang.IllegalAccessException
        Deprecated.
        Convenience method to obtain all variables and values from the mojo (including its superclasses) Note: the values in the map are of type Object so the caller is responsible for casting to desired types.
        Parameters:
        clazz -
        object -
        Returns:
        map of variable names and values
        Throws:
        java.lang.IllegalAccessException
      • setVariableValueToObject

        protected <T> void setVariableValueToObject​(java.lang.Object object,
                                                    java.lang.String variable,
                                                    T value)
                                             throws java.lang.IllegalAccessException
        Deprecated.
        Convenience method to set values to variables in objects that don't have setters
        Parameters:
        object -
        variable -
        value -
        Throws:
        java.lang.IllegalAccessException