Version 4

    Unit Tests with Maven2

     

    Look at the following pom.xml that makes use of unit tests with reporting etc.

    http://anonsvn.jboss.org/repos/jbossas/projects/security/security-jboss-sx/trunk/pom.xml

     

     

    - You will need to use "mvn site" for the reports for running the tests.(???)

     

     

    - You can use the following test plugin to configure the reports and to ignore test failures such that the artifacts are produced.

      <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <printSummary>true</printSummary>
              <disableXmlReport>false</disableXmlReport>
              <testFailureIgnore>true</testFailureIgnore>
              <includes>
                <include>**/**TestCase.java</include>
              </includes>
              <forkMode>pertest</forkMode>
            </configuration>
          </plugin>
    

     

    Caveats

    • Surefire plugin looks for the environment variable "JAVA_HOME". Ensure that it is set to JDK5 (if you need it).