|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.codehaus.plexus.PlexusTestCase
org.apache.maven.plugin.testing.AbstractMojoTestCase
public abstract class AbstractMojoTestCase
TODO: add a way to use the plugin POM for the lookup so that the user doesn't have to provide the a:g:v:goal as the role hint for the mojo lookup. TODO: standardize the execution of the mojo and looking at the results, but could simply have a template method for verifying the state of the mojo post execution TODO: need a way to look at the state of the mojo without adding getters, this could be where we finally specify the expressions which extract values from the mojo. TODO: create a standard directory structure for picking up POMs to make this even easier, we really just need a testing descriptor and make this entirely declarative!
| 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,
String artifactId,
File pom)
Configure the mojo |
protected org.codehaus.plexus.configuration.PlexusConfiguration |
extractPluginConfiguration(String artifactId,
File pom)
|
protected org.codehaus.plexus.configuration.PlexusConfiguration |
extractPluginConfiguration(String artifactId,
org.codehaus.plexus.util.xml.Xpp3Dom pomDom)
|
protected org.codehaus.plexus.PlexusContainer |
getContainer()
|
protected String |
getPluginDescriptorLocation()
|
protected String |
getPluginDescriptorPath()
|
protected InputStream |
getPublicDescriptorStream()
|
protected Map<String,Object> |
getVariablesAndValuesFromObject(Class<?> clazz,
Object object)
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 Map<String,Object> |
getVariablesAndValuesFromObject(Object object)
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 Object |
getVariableValueFromObject(Object object,
String variable)
Convenience method to obtain the value of a variable on a mojo that might not have a getter. |
protected org.apache.maven.plugin.Mojo |
lookupConfiguredMojo(org.apache.maven.project.MavenProject project,
String goal)
|
protected org.apache.maven.plugin.Mojo |
lookupConfiguredMojo(org.apache.maven.execution.MavenSession session,
org.apache.maven.plugin.MojoExecution execution)
|
protected org.apache.maven.plugin.Mojo |
lookupEmptyMojo(String goal,
File pom)
Lookup the mojo leveraging the actual subprojects pom |
protected org.apache.maven.plugin.Mojo |
lookupEmptyMojo(String goal,
String pluginPom)
Lookup an empty mojo |
protected org.apache.maven.plugin.Mojo |
lookupMojo(String goal,
File pom)
Lookup the mojo leveraging the actual subprojects pom |
protected org.apache.maven.plugin.Mojo |
lookupMojo(String goal,
String pluginPom)
Lookup the mojo leveraging the subproject pom |
protected org.apache.maven.plugin.Mojo |
lookupMojo(String groupId,
String artifactId,
String version,
String goal,
org.codehaus.plexus.configuration.PlexusConfiguration pluginConfiguration)
lookup the mojo while we have all of the relavent information |
protected org.apache.maven.execution.MavenSession |
newMavenSession(org.apache.maven.project.MavenProject project)
|
protected org.apache.maven.plugin.MojoExecution |
newMojoExecution(String goal)
|
protected void |
setUp()
|
protected void |
setupContainer()
|
protected org.codehaus.plexus.ContainerConfiguration |
setupContainerConfiguration()
|
protected void |
setVariableValueToObject(Object object,
String variable,
Object value)
Convenience method to set values to variables in objects that don't have setters |
| Methods inherited from class org.codehaus.plexus.PlexusTestCase |
|---|
customizeComponentConfiguration, customizeContainerConfiguration, customizeContext, getBasedir, getClassLoader, getConfiguration, getConfiguration, getConfigurationName, getCustomConfigurationName, getResourceAsStream, getTestConfiguration, getTestConfiguration, getTestFile, getTestFile, getTestPath, getTestPath, lookup, lookup, 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, failNotEquals, failNotSame, failSame, format |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractMojoTestCase()
| Method Detail |
|---|
protected void setUp()
throws Exception
setUp in class org.codehaus.plexus.PlexusTestCaseException
protected InputStream getPublicDescriptorStream()
throws Exception
Exceptionprotected String getPluginDescriptorPath()
protected String getPluginDescriptorLocation()
protected void setupContainer()
setupContainer in class org.codehaus.plexus.PlexusTestCaseprotected org.codehaus.plexus.ContainerConfiguration setupContainerConfiguration()
protected org.codehaus.plexus.PlexusContainer getContainer()
getContainer in class org.codehaus.plexus.PlexusTestCase
protected org.apache.maven.plugin.Mojo lookupMojo(String goal,
String pluginPom)
throws Exception
goal - pluginPom -
Exception
protected org.apache.maven.plugin.Mojo lookupEmptyMojo(String goal,
String pluginPom)
throws Exception
goal - pluginPom -
Exception
protected org.apache.maven.plugin.Mojo lookupMojo(String goal,
File pom)
throws Exception
goal - pom -
Exception
protected org.apache.maven.plugin.Mojo lookupEmptyMojo(String goal,
File pom)
throws Exception
goal - pom -
Exception
protected org.apache.maven.plugin.Mojo lookupMojo(String groupId,
String artifactId,
String version,
String goal,
org.codehaus.plexus.configuration.PlexusConfiguration pluginConfiguration)
throws Exception
groupId - artifactId - version - goal - pluginConfiguration -
Exception
protected org.apache.maven.plugin.Mojo lookupConfiguredMojo(org.apache.maven.project.MavenProject project,
String goal)
throws Exception
project - goal -
Exception
protected org.apache.maven.plugin.Mojo lookupConfiguredMojo(org.apache.maven.execution.MavenSession session,
org.apache.maven.plugin.MojoExecution execution)
throws Exception,
org.codehaus.plexus.component.configurator.ComponentConfigurationException
session - execution -
Exception
org.codehaus.plexus.component.configurator.ComponentConfigurationExceptionprotected org.apache.maven.execution.MavenSession newMavenSession(org.apache.maven.project.MavenProject project)
project -
protected org.apache.maven.plugin.MojoExecution newMojoExecution(String goal)
goal -
protected org.codehaus.plexus.configuration.PlexusConfiguration extractPluginConfiguration(String artifactId,
File pom)
throws Exception
artifactId - pom -
Exception
protected org.codehaus.plexus.configuration.PlexusConfiguration extractPluginConfiguration(String artifactId,
org.codehaus.plexus.util.xml.Xpp3Dom pomDom)
throws Exception
artifactId - pomDom -
Exception
protected org.apache.maven.plugin.Mojo configureMojo(org.apache.maven.plugin.Mojo mojo,
String artifactId,
File pom)
throws Exception
mojo - artifactId - pom -
Exception
protected org.apache.maven.plugin.Mojo configureMojo(org.apache.maven.plugin.Mojo mojo,
org.codehaus.plexus.configuration.PlexusConfiguration pluginConfiguration)
throws Exception
mojo - pluginConfiguration -
Exception
protected Object getVariableValueFromObject(Object object,
String variable)
throws IllegalAccessException
object - variable -
IllegalArgumentException
IllegalAccessException
protected Map<String,Object> getVariablesAndValuesFromObject(Object object)
throws IllegalAccessException
object -
IllegalAccessException
protected Map<String,Object> getVariablesAndValuesFromObject(Class<?> clazz,
Object object)
throws IllegalAccessException
clazz - object -
IllegalAccessException
protected void setVariableValueToObject(Object object,
String variable,
Object value)
throws IllegalAccessException
object - variable - value -
IllegalAccessException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||