Unit Tests
Running from the command line
cd to the application/ directory
Run all the unit tests:
mvn clean testRun one test:
mvn test -Dtest=TheNameOfYourTestClassRun from Eclipse: right click on test class > Run As > JUnit Test
Developing Unit Tests
Under no circumstances the unit tests should touch the database! Use mock objects or in-memory implementations. The unit tests need to run quickly, and touching a database makes them slow and fragile.
NOTE: Only unit tests are not enough to confirm that build is not broken after a change in main code, hence you should always consider running all the tests by
mvn clean installTest classes with naming pattern _IntegrationTest or _StrutsTest are integration tests, excluding these all are unit tests in application module.
Also see Application Module & Integration Tests.