Skip to content

Instantly share code, notes, and snippets.

@sully6768
Created June 4, 2012 23:05
Show Gist options
  • Save sully6768/2871383 to your computer and use it in GitHub Desktop.
Save sully6768/2871383 to your computer and use it in GitHub Desktop.
Aether Plugin Test - Mojo Test
import java.io.File;
import org.apache.maven.plugin.testing.AbstractMojoTestCase;
public class MyAetherMojoTest extends AbstractMojoTestCase
{
/** {@inheritDoc} */
protected void setUp()
throws Exception
{
// required
super.setUp();
}
/** {@inheritDoc} */
protected void tearDown()
throws Exception
{
// required
super.tearDown();
}
/**
* @throws Exception if any
*/
public void testSomething()
throws Exception
{
File pom = getTestFile( "src/test/resources/unit/test1/pom.xml" );
assertNotNull( pom );
assertTrue( pom.exists() );
MyAetherMojo myMojo = (MyAetherMojo) lookupMojo( "resolve", pom );
assertNotNull( myMojo );
myMojo.execute();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment