View RSS Feed

My Java Tips

Using Maven - Unit Tests

Rate this Entry
by , 11-05-2011 at 07:00 PM (519 Views)
You want Maven to compile your unit tests. Simply place you unit tests in a directory and mention the director under
unitTestSourceDirectory´tags.

src/test




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.



Java Code:
         **/*Test*.java 
       
       
         **/BaseTestCase.java
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.

Submit "Using Maven - Unit Tests" to Facebook Submit "Using Maven - Unit Tests" to Digg Submit "Using Maven - Unit Tests" to del.icio.us Submit "Using Maven - Unit Tests" to StumbleUpon Submit "Using Maven - Unit Tests" to Google

Tags: None Add / Edit Tags
Categories
Maven

Comments