Using Maven - Unit Tests
5 June 2008You want Maven to compile your unit tests. Simply place you unit tests in a directory and mention the director under
unitTestSourceDirectory´tags.
<unitTestSourceDirectory>src/test</unitTestSourceDirectory>
Once that is done, specify the unit tests which you want to run in unitTest XML element. You may use includes and excludes tags to include or exclude the classes.
<unitTest >
<includes >
<include >**/*Test*.java </include >
</includes >
<excludes >
<exclude >**/BaseTestCase.java </exclude >
</excludes >
</unitTest >So that means the Maven provides you the goal (target) to run the unit tests which makes life easier for the developer. Do try it.
Related Posts:
Top Of Page | Trackback
If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.
It will look like this: Using Maven - Unit Tests