org.apache.maven.plugin.testing

Class AbstractMojoTestCase

public abstract class AbstractMojoTestCase extends PlexusTestCase

Method Summary
protected MojoconfigureMojo(Mojo mojo, String artifactId, File pom)
protected MojoconfigureMojo(Mojo mojo, PlexusConfiguration pluginConfiguration)
configure the mojo with the given plexus configuration
protected PlexusConfigurationextractPluginConfiguration(String artifactId, File pom)
protected PlexusConfigurationextractPluginConfiguration(String artifactId, Xpp3Dom pomDom)
protected MapgetVariablesAndValuesFromObject(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 MapgetVariablesAndValuesFromObject(Class clazz, 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 ObjectgetVariableValueFromObject(Object object, String variable)
convience method to obtain the value of a variable on a mojo that might not have a getter.
protected MojolookupEmptyMojo(String goal, String pluginPom)
lookup an empty mojo
protected MojolookupEmptyMojo(String goal, File pom)
lookup the mojo leveraging the actual subprojects pom
protected MojolookupMojo(String goal, String pluginPom)
lookup the mojo leveraging the subproject pom
protected MojolookupMojo(String goal, File pom)
lookup the mojo leveraging the actual subprojects pom
protected MojolookupMojo(String groupId, String artifactId, String version, String goal, PlexusConfiguration pluginConfiguration)
lookup the mojo while we have all of the relavent information
protected voidsetUp()
protected voidsetVariableValueToObject(Object object, String variable, Object value)
convience method to set values to variables in objects that don't have setters

Method Detail

configureMojo

protected Mojo configureMojo(Mojo mojo, String artifactId, File pom)

configureMojo

protected Mojo configureMojo(Mojo mojo, PlexusConfiguration pluginConfiguration)
configure the mojo with the given plexus configuration

Parameters: mojo pluginConfiguration

Returns:

Throws: Exception

extractPluginConfiguration

protected PlexusConfiguration extractPluginConfiguration(String artifactId, File pom)

extractPluginConfiguration

protected PlexusConfiguration extractPluginConfiguration(String artifactId, Xpp3Dom pomDom)

getVariablesAndValuesFromObject

protected Map getVariablesAndValuesFromObject(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.

Parameters: object

Returns: map of variable names and values

getVariablesAndValuesFromObject

protected Map getVariablesAndValuesFromObject(Class clazz, 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.

Parameters: clazz object

Returns: map of variable names and values

getVariableValueFromObject

protected Object getVariableValueFromObject(Object object, String variable)
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: IllegalArgumentException

lookupEmptyMojo

protected Mojo lookupEmptyMojo(String goal, String pluginPom)
lookup an empty mojo

lookupEmptyMojo

protected Mojo lookupEmptyMojo(String goal, File pom)
lookup the mojo leveraging the actual subprojects pom

Parameters: goal pom

Returns:

Throws: Exception

lookupMojo

protected Mojo lookupMojo(String goal, String pluginPom)
lookup the mojo leveraging the subproject pom

lookupMojo

protected Mojo lookupMojo(String goal, File pom)
lookup the mojo leveraging the actual subprojects pom

Parameters: goal pom

Returns:

Throws: Exception

lookupMojo

protected Mojo lookupMojo(String groupId, String artifactId, String version, String goal, PlexusConfiguration pluginConfiguration)
lookup the mojo while we have all of the relavent information

Parameters: groupId artifactId version goal pluginConfiguration

Returns:

Throws: Exception

setUp

protected void setUp()

setVariableValueToObject

protected void setVariableValueToObject(Object object, String variable, Object value)
convience method to set values to variables in objects that don't have setters

Parameters: object variable value

Throws: IllegalAccessException

Copyright © {inceptionYear}-2009 null. All Rights Reserved.