Package org.apache.maven.plugin.testing
Class AbstractMojoTestCase
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.codehaus.plexus.PlexusTestCase
org.apache.maven.plugin.testing.AbstractMojoTestCase
- All Implemented Interfaces:
junit.framework.Test
Deprecated.
- Author:
- jesse
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddGuiceModules(List<com.google.inject.Module> modules) Deprecated.protected <T extends org.apache.maven.plugin.Mojo>
TconfigureMojo(T mojo, String artifactId, File pom) Deprecated.Configure the mojoprotected <T extends org.apache.maven.plugin.Mojo>
TconfigureMojo(T mojo, org.codehaus.plexus.configuration.PlexusConfiguration pluginConfiguration) Deprecated.Configure the mojo with the given plexus configurationprotected org.codehaus.plexus.configuration.PlexusConfigurationextractPluginConfiguration(String artifactId, File pom) Deprecated.protected org.codehaus.plexus.configuration.PlexusConfigurationextractPluginConfiguration(String artifactId, org.codehaus.plexus.util.xml.Xpp3Dom pomDom) Deprecated.protected org.codehaus.plexus.PlexusContainerDeprecated.protected StringDeprecated.protected StringDeprecated.protected InputStreamDeprecated.getVariablesAndValuesFromObject(Class<?> clazz, 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.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> TgetVariableValueFromObject(Object object, 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>
TlookupConfiguredMojo(org.apache.maven.execution.MavenSession session, org.apache.maven.plugin.MojoExecution execution) Deprecated.protected <T extends org.apache.maven.plugin.Mojo>
TlookupConfiguredMojo(org.apache.maven.project.MavenProject project, String goal) Deprecated.protected <T extends org.apache.maven.plugin.Mojo>
TlookupEmptyMojo(String goal, File pom) Deprecated.Lookup the mojo leveraging the actual subprojects pomprotected <T extends org.apache.maven.plugin.Mojo>
TlookupEmptyMojo(String goal, String pluginPom) Deprecated.Lookup an empty mojoprotected <T extends org.apache.maven.plugin.Mojo>
TlookupMojo(String goal, File pom) Deprecated.Lookup the mojo leveraging the actual subprojects pomprotected <T extends org.apache.maven.plugin.Mojo>
TlookupMojo(String goal, String pluginPom) Deprecated.Lookup the mojo leveraging the subproject pomprotected <T extends org.apache.maven.plugin.Mojo>
TlookupMojo(String groupId, String artifactId, String version, String goal, org.codehaus.plexus.configuration.PlexusConfiguration pluginConfiguration) Deprecated.lookup the mojo while we have all of the relavent informationprotected org.apache.maven.execution.MavenSessionnewMavenSession(org.apache.maven.project.MavenProject project) Deprecated.protected org.apache.maven.plugin.MojoExecutionnewMojoExecution(String goal) Deprecated.protected voidsetUp()Deprecated.protected voidDeprecated.protected org.codehaus.plexus.ContainerConfigurationDeprecated.protected <T> voidsetVariableValueToObject(Object object, String variable, T value) Deprecated.Convenience method to set values to variables in objects that don't have settersMethods 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, teardownContainerMethods 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
-
Constructor Details
-
AbstractMojoTestCase
public AbstractMojoTestCase()Deprecated.
-
-
Method Details
-
setUp
Deprecated.- Overrides:
setUpin classorg.codehaus.plexus.PlexusTestCase- Throws:
Exception
-
getPublicDescriptorStream
Deprecated.- Throws:
Exception
-
getPluginDescriptorPath
Deprecated. -
getPluginDescriptorLocation
Deprecated. -
setupContainer
protected void setupContainer()Deprecated.- Overrides:
setupContainerin classorg.codehaus.plexus.PlexusTestCase
-
addGuiceModules
Deprecated.- Since:
- 3.0.0
-
setupContainerConfiguration
protected org.codehaus.plexus.ContainerConfiguration setupContainerConfiguration()Deprecated. -
getContainer
protected org.codehaus.plexus.PlexusContainer getContainer()Deprecated.- Overrides:
getContainerin classorg.codehaus.plexus.PlexusTestCase
-
lookupMojo
protected <T extends org.apache.maven.plugin.Mojo> T lookupMojo(String goal, String pluginPom) throws Exception Deprecated.Lookup the mojo leveraging the subproject pom- Parameters:
goal-pluginPom-- Returns:
- a Mojo instance
- Throws:
Exception
-
lookupEmptyMojo
protected <T extends org.apache.maven.plugin.Mojo> T lookupEmptyMojo(String goal, String pluginPom) throws Exception Deprecated.Lookup an empty mojo- Parameters:
goal-pluginPom-- Returns:
- a Mojo instance
- Throws:
Exception
-
lookupMojo
protected <T extends org.apache.maven.plugin.Mojo> T lookupMojo(String goal, File pom) throws Exception Deprecated.Lookup the mojo leveraging the actual subprojects pom- Parameters:
goal-pom-- Returns:
- a Mojo instance
- Throws:
Exception
-
lookupEmptyMojo
protected <T extends org.apache.maven.plugin.Mojo> T lookupEmptyMojo(String goal, File pom) throws Exception Deprecated.Lookup the mojo leveraging the actual subprojects pom- Parameters:
goal-pom-- Returns:
- a Mojo instance
- Throws:
Exception
-
lookupMojo
protected <T extends org.apache.maven.plugin.Mojo> T lookupMojo(String groupId, String artifactId, String version, String goal, org.codehaus.plexus.configuration.PlexusConfiguration pluginConfiguration) throws Exception Deprecated.lookup the mojo while we have all of the relavent information- Parameters:
groupId-artifactId-version-goal-pluginConfiguration-- Returns:
- a Mojo instance
- Throws:
Exception
-
lookupConfiguredMojo
protected <T extends org.apache.maven.plugin.Mojo> T lookupConfiguredMojo(org.apache.maven.project.MavenProject project, String goal) throws Exception Deprecated.- Parameters:
project-goal-- Returns:
- Throws:
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 Exception, org.codehaus.plexus.component.configurator.ComponentConfigurationException Deprecated.- Parameters:
session-execution-- Returns:
- Throws:
Exceptionorg.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
Deprecated.- Parameters:
goal-- Returns:
- Since:
- 2.0
-
extractPluginConfiguration
protected org.codehaus.plexus.configuration.PlexusConfiguration extractPluginConfiguration(String artifactId, File pom) throws Exception Deprecated.- Parameters:
artifactId-pom-- Returns:
- the plexus configuration
- Throws:
Exception
-
extractPluginConfiguration
protected org.codehaus.plexus.configuration.PlexusConfiguration extractPluginConfiguration(String artifactId, org.codehaus.plexus.util.xml.Xpp3Dom pomDom) throws Exception Deprecated.- Parameters:
artifactId-pomDom-- Returns:
- the plexus configuration
- Throws:
Exception
-
configureMojo
protected <T extends org.apache.maven.plugin.Mojo> T configureMojo(T mojo, String artifactId, File pom) throws Exception Deprecated.Configure the mojo- Parameters:
mojo-artifactId-pom-- Returns:
- a Mojo instance
- Throws:
Exception
-
configureMojo
protected <T extends org.apache.maven.plugin.Mojo> T configureMojo(T mojo, org.codehaus.plexus.configuration.PlexusConfiguration pluginConfiguration) throws Exception Deprecated.Configure the mojo with the given plexus configuration- Parameters:
mojo-pluginConfiguration-- Returns:
- a Mojo instance
- Throws:
Exception
-
getVariableValueFromObject
protected <T> T getVariableValueFromObject(Object object, String variable) throws 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:
IllegalArgumentExceptionIllegalAccessException
-
getVariablesAndValuesFromObject
protected Map<String,Object> getVariablesAndValuesFromObject(Object object) throws 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:
IllegalAccessException
-
getVariablesAndValuesFromObject
protected Map<String,Object> getVariablesAndValuesFromObject(Class<?> clazz, Object object) throws 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:
IllegalAccessException
-
setVariableValueToObject
protected <T> void setVariableValueToObject(Object object, String variable, T value) throws IllegalAccessException Deprecated.Convenience method to set values to variables in objects that don't have setters- Parameters:
object-variable-value-- Throws:
IllegalAccessException
-
MojoTestinstead.