Package org.wildfly.plugin.tests
Class AbstractWildFlyMojoTest
- java.lang.Object
-
- org.wildfly.plugin.tests.AbstractWildFlyMojoTest
-
- Direct Known Subclasses:
AbstractWildFlyServerMojoTest
public abstract class AbstractWildFlyMojoTest extends Object
- Author:
- James R. Perkins
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringBASE_CONFIG_DIRprotected StringDEPLOYMENT_NAMEorg.apache.maven.plugin.testing.MojoRulerule
-
Constructor Summary
Constructors Constructor Description AbstractWildFlyMojoTest()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PathgetBaseDir()protected DeploymentgetDeployment()Returns the deployment test.war from the test resources.static PathgetPomFile(String fileName)<T extends org.apache.maven.plugin.Mojo>
TlookupMojoAndVerify(String goal, String fileName)Configures a MOJO based on the goal and the pom file then verifies the goal MOJO was found.org.apache.maven.project.MavenProjectreadMavenProject(Path pom)protected static voidsetDefaultEnvironment(org.apache.maven.plugin.Mojo instance)protected static voidsetValidSession(org.apache.maven.plugin.Mojo mojo)protected static voidsetValue(Object instance, String name, Object value)
-
-
-
Field Detail
-
DEPLOYMENT_NAME
protected final String DEPLOYMENT_NAME
- See Also:
- Constant Field Values
-
BASE_CONFIG_DIR
protected static final String BASE_CONFIG_DIR
-
rule
public org.apache.maven.plugin.testing.MojoRule rule
-
-
Method Detail
-
getDeployment
protected Deployment getDeployment()
Returns the deployment test.war from the test resources.- Returns:
- the deployment
-
lookupMojoAndVerify
public <T extends org.apache.maven.plugin.Mojo> T lookupMojoAndVerify(String goal, String fileName) throws Exception
Configures a MOJO based on the goal and the pom file then verifies the goal MOJO was found.- Parameters:
goal- the name of the goal being testedfileName- the name of the POM file to be used during testing- Returns:
- the MOJO object under test
- Throws:
AssertionError- if the MOJO was not foundException
-
getBaseDir
public static Path getBaseDir()
-
readMavenProject
public org.apache.maven.project.MavenProject readMavenProject(Path pom) throws Exception
- Throws:
Exception
-
setDefaultEnvironment
protected static void setDefaultEnvironment(org.apache.maven.plugin.Mojo instance) throws NoSuchFieldException, IllegalAccessException
-
setValue
protected static void setValue(Object instance, String name, Object value) throws NoSuchFieldException, IllegalAccessException
-
setValidSession
protected static void setValidSession(org.apache.maven.plugin.Mojo mojo) throws org.eclipse.aether.repository.NoLocalRepositoryManagerException, NoSuchFieldException, IllegalAccessException- Throws:
org.eclipse.aether.repository.NoLocalRepositoryManagerExceptionNoSuchFieldExceptionIllegalAccessException
-
-