org.apache.maven.plugin.testing
Class AbstractMojoTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.codehaus.plexus.PlexusTestCase
              extended by org.apache.maven.plugin.testing.AbstractMojoTestCase
All Implemented Interfaces:
junit.framework.Test

public abstract class AbstractMojoTestCase
extends org.codehaus.plexus.PlexusTestCase


Field Summary
 
Fields inherited from class org.codehaus.plexus.PlexusTestCase
basedir, container
 
Constructor Summary
AbstractMojoTestCase()
           
 
Method Summary
protected  org.apache.maven.plugin.Mojo configureMojo(org.apache.maven.plugin.Mojo mojo, org.codehaus.plexus.configuration.PlexusConfiguration pluginConfiguration)
          configure the mojo with the given plexus configuration
protected  org.apache.maven.plugin.Mojo configureMojo(org.apache.maven.plugin.Mojo mojo, java.lang.String artifactId, java.io.File pom)
           
protected  org.codehaus.plexus.configuration.PlexusConfiguration extractPluginConfiguration(java.lang.String artifactId, java.io.File pom)
           
protected  org.codehaus.plexus.configuration.PlexusConfiguration extractPluginConfiguration(java.lang.String artifactId, org.codehaus.plexus.util.xml.Xpp3Dom pomDom)
           
protected  java.util.Map getVariablesAndValuesFromObject(java.lang.Class clazz, java.lang.Object object)
          convience 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 getVariablesAndValuesFromObject(java.lang.Object object)
          convience 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.lang.Object getVariableValueFromObject(java.lang.Object object, java.lang.String variable)
          convience method to obtain the value of a variable on a mojo that might not have a getter.
protected  org.apache.maven.plugin.Mojo lookupEmptyMojo(java.lang.String goal, java.io.File pom)
          lookup the mojo leveraging the actual subprojects pom
protected  org.apache.maven.plugin.Mojo lookupEmptyMojo(java.lang.String goal, java.lang.String pluginPom)
          lookup an empty mojo
protected  org.apache.maven.plugin.Mojo lookupMojo(java.lang.String goal, java.io.File pom)
          lookup the mojo leveraging the actual subprojects pom
protected  org.apache.maven.plugin.Mojo lookupMojo(java.lang.String goal, java.lang.String pluginPom)
          lookup the mojo leveraging the subproject pom
protected  org.apache.maven.plugin.Mojo lookupMojo(java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String goal, org.codehaus.plexus.configuration.PlexusConfiguration pluginConfiguration)
          lookup the mojo while we have all of the relavent information
protected  void setUp()
           
protected  void setVariableValueToObject(java.lang.Object object, java.lang.String variable, java.lang.Object value)
          convience method to set values to variables in objects that don't have setters
 
Methods inherited from class org.codehaus.plexus.PlexusTestCase
createContainerInstance, customizeContext, customizeContext, getBasedir, getClassLoader, getConfiguration, getConfiguration, getContainer, getCustomConfiguration, getResourceAsStream, getTestFile, getTestFile, getTestPath, getTestPath, lookup, lookup, release, tearDown
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractMojoTestCase

public AbstractMojoTestCase()
Method Detail

setUp

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

lookupMojo

protected org.apache.maven.plugin.Mojo lookupMojo(java.lang.String goal,
                                                  java.lang.String pluginPom)
                                           throws java.lang.Exception
lookup the mojo leveraging the subproject pom

Throws:
java.lang.Exception

lookupEmptyMojo

protected org.apache.maven.plugin.Mojo lookupEmptyMojo(java.lang.String goal,
                                                       java.lang.String pluginPom)
                                                throws java.lang.Exception
lookup an empty mojo

Throws:
java.lang.Exception

lookupMojo

protected org.apache.maven.plugin.Mojo lookupMojo(java.lang.String goal,
                                                  java.io.File pom)
                                           throws java.lang.Exception
lookup the mojo leveraging the actual subprojects pom

Parameters:
goal -
pom -
Returns:
Throws:
java.lang.Exception

lookupEmptyMojo

protected org.apache.maven.plugin.Mojo lookupEmptyMojo(java.lang.String goal,
                                                       java.io.File pom)
                                                throws java.lang.Exception
lookup the mojo leveraging the actual subprojects pom

Parameters:
goal -
pom -
Returns:
Throws:
java.lang.Exception

lookupMojo

protected org.apache.maven.plugin.Mojo 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
lookup the mojo while we have all of the relavent information

Parameters:
groupId -
artifactId -
version -
goal -
pluginConfiguration -
Returns:
Throws:
java.lang.Exception

extractPluginConfiguration

protected org.codehaus.plexus.configuration.PlexusConfiguration extractPluginConfiguration(java.lang.String artifactId,
                                                                                           java.io.File pom)
                                                                                    throws java.lang.Exception
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
Throws:
java.lang.Exception

configureMojo

protected org.apache.maven.plugin.Mojo configureMojo(org.apache.maven.plugin.Mojo mojo,
                                                     java.lang.String artifactId,
                                                     java.io.File pom)
                                              throws java.lang.Exception
Throws:
java.lang.Exception

configureMojo

protected org.apache.maven.plugin.Mojo configureMojo(org.apache.maven.plugin.Mojo mojo,
                                                     org.codehaus.plexus.configuration.PlexusConfiguration pluginConfiguration)
                                              throws java.lang.Exception
configure the mojo with the given plexus configuration

Parameters:
mojo -
pluginConfiguration -
Returns:
Throws:
java.lang.Exception

getVariableValueFromObject

protected java.lang.Object getVariableValueFromObject(java.lang.Object object,
                                                      java.lang.String variable)
                                               throws java.lang.IllegalAccessException
convience 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 getVariablesAndValuesFromObject(java.lang.Object object)
                                                 throws java.lang.IllegalAccessException
convience 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 getVariablesAndValuesFromObject(java.lang.Class clazz,
                                                        java.lang.Object object)
                                                 throws java.lang.IllegalAccessException
convience 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 void setVariableValueToObject(java.lang.Object object,
                                        java.lang.String variable,
                                        java.lang.Object value)
                                 throws java.lang.IllegalAccessException
convience method to set values to variables in objects that don't have setters

Parameters:
object -
variable -
value -
Throws:
java.lang.IllegalAccessException


Copyright © 2002-2006 Apache Software Foundation. All Rights Reserved.