November 05, 2004

Running a single test in Maven?

We've been using Maven pretty heavily in a few projects, and after seeing what it can do, I couldn't go without it now. It's a really useful tool and can make things quite easy, especially being able to look at a build from a project view, rather than a task view. This is all probably worth another post on its own :)

Integrated unit testing is one useful feature, by supplying your unit test source directory to your project object model, all JUnit tests are automatically run, post compile. The user guide goes through all of the details.

What if you want to run one unit test though, without the others - this I found out today:

$> maven -Dtestcase=<testcase-class-name> test:single

The maven test plugin page has descriptions of the different goals that can be run on your test cases.

Posted by crafterm at November 5, 2004 01:14 PM | TrackBack
Comments
Post a comment









Remember personal info?