Using Maven - Unit Tests

5 June 2008

You 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.

del.icio.us:Using Maven - Unit Tests  digg:Using Maven - Unit Tests  spurl:Using Maven - Unit Tests  wists:Using Maven - Unit Tests  simpy:Using Maven - Unit Tests  newsvine:Using Maven - Unit Tests  blinklist:Using Maven - Unit Tests  furl:Using Maven - Unit Tests  reddit:Using Maven - Unit Tests  fark:Using Maven - Unit Tests  blogmarks:Using Maven - Unit Tests  Y!:Using Maven - Unit Tests  smarking:Using Maven - Unit Tests  magnolia:Using Maven - Unit Tests  segnalo:Using Maven - Unit Tests  gifttagging:Using Maven - Unit Tests

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

Leave a Reply