Still going with the maven-dependency-plugin testing, I have the
following setup using 1.0-SNAPSHOT of the testing-harness:
 
plugin-config.xml:
<project>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
          <configuration>
          </configuration>
      </plugin>
    </plugins>
  </build>
    <dependencies>
        <dependency>
          <groupId>org.apache.maven</groupId>
          <artifactId>maven-artifact</artifactId>
          <version>2.0.4</version>
        </dependency>
    </dependencies>
</project>
 
 
Test:
public class TestResolveMojo
    extends AbstractMojoTestCase
{
    protected void setUp()
        throws Exception
    {
        // required for mojo lookups to work
        super.setUp();
    }
 
    /**
     * tests the proper discovery and configuration of the mojo
     * 
     * @throws Exception
     */
    public void testresolveTestEnvironment()
        throws Exception
    {
        File testPom = new File( getBasedir(),
"target/test-classes/unit/resolve-test/plugin-config.xml" );
        ResolveDependenciesMojo mojo = (ResolveDependenciesMojo)
lookupMojo( "resolve", testPom );
 
        assertNotNull( mojo );
        mojo.execute();
    }
}
 
 
The problem is that when I execute the mojo, the project is null and my
testing comes to a screaching halt. What am I missing?
 

Reply via email to