JUnit and Integration tests
Integration tests are run using the maven failsafe plugin. For detailed information see the Maven failsafe documentation.
- any JUnit class Test* or *Test will be run by the test target
- any JUnit class IT* or *IT will be run by the verify target (run after the test target)
Usually the following are unit tests:
- any test that mocks almost all dependencies
- any test that does not depend on any database (hsqldb included)
The following should be considered integration tests:
- any test that boots an AcrossContext that contains the module under test or the modules it depends on
The failsafe plugin needs to be configured in the pom.xml. For simplicity sake (buildserver and Sonar integration), the failsafe reports are put in the same folder as the surefire (unit tests) reports.
Running only the integration tests
When you execute mvn verify then first the unit tests will be executed, followed by the integration tests. You can run only the integration tests by running mvn failsafe:integration-test. If you start from a clean checkout, you need to compile them as well: use mvn compile test-compile failsafe:integration-test.
If a module extends the database schema, it should preferably have one or more integration tests that perform the module installation and can easily be re-run against different datasources.
Integration tests can easily be written using the Across test library, see /wiki/spaces/AX/pages/12648455.
The buildserver is provided with a default across-test.properties containing the following datasources:
|mysql||MySQL 5 (linux)|
|oracle||Oracle 11G (Windows)|
|mssql||SQL Server 2008|
See /wiki/spaces/AX/pages/12648483 for naming conventions and sql scripts