Mojo testing is something I have been wanting to raise on this list for last couple of days as well ;-)

Following is the only reference available, I have been digging into sources last couple of days to code up mojo tests.

http://docs.codehaus.org/display/MAVEN/Maven+Plugin+Harness

Apparently there are different posssible approaches to unit testing Mojos/Plugins. This is what I found:
a) Simple JUnit test case.
b) extend PlexusTestCase (see Continuum IT sources)
c) extend AbstractMojoTestCase (see maven-install-plugin sources).
d) use Maven Embedder, Plexus Commandline utils (see under maven-eclipse-plugin sources - master project test) e) use JMockObjects (see maven-clover-plugin or Cargo Maven extension sources).

It would be great if Maven devs (or others) can chip in notes/thoughts on these approaches and what might be the appropriate scenarios for each approach :-) - I am happy to document them!

Cheers,
Rahul



----- Original Message ----- From: "Michael Meyer" <[EMAIL PROTECTED]>
To: "Maven Users List" <[email protected]>
Sent: Thursday, April 20, 2006 5:04 AM
Subject: [M203] Writing tests for Plugins (Java Mojos)


Hi,
is there any documentation around about writing tests for maven plugins?
I saw that some plugins subclass org.codehaus.plexus.PlexusTestCase
for theire tests but a simple example of a "typical" maven plugin test
would be helpful.

michael

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



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

Reply via email to