I have the same isssue. You need to write a Mock object for the
project and specify the implementation in your config. See confluence
for more details (and the javadoc plugin as Vincent S. suggested
yesterday).

Let's discuss this here because it seems I'll came accross the same
issues soon :)

Cheers,
Stéphane

On 9/13/06, Brian E. Fox <[EMAIL PROTECTED]> wrote:
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?





--
Un chewing-gum? Non merci, jamais pour parler.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to