Testing - GeoscienceAustralia/egeodesy GitHub Wiki
There are the following tests for domain-model and web-services (the others have unit tests only):
- Unit (default)
- Integration (no Sonar analysis)
- System (no Sonar analysis)
- Sonar Analysis (runs its own Integration and Functional tests)
All tests can be prevented by using the skipTests
argument:
mvn clean install -DskipTests
Unit tests
These are run during the build process so can be achieved by invoking any Maven phase:
mvn test
mvn install
mvn package
To runs specific tests use the test argument:
mvn test -Dtest=SomeTest
Unit tests are found in the src/test/java
source directory and end with a Test.java
suffix.
Integration (no Sonar analysis)
These are run under the integration-test
profile.
mvn clean verify -Pintegration-test
To runs specific tests use the it.test argument:
mvn verify -Dit.test=SomeTest
Integration tests are found in the src/integration-test/java
source directory and end with a IT.java
suffix.
System (no Sonar analysis)
These are run under the system-test
profile.
mvn clean verify -Psystem-test
To runs specific tests use the it.test argument:
mvn verify -Dit.test=SomeTest
System tests are found in the src/test/java
source directory under the au.gov.ga.geodesy.test.system
package and have no specific suffix requirements.
Sonar Analysis
This runs its own Integration and Functional tests - necessary as instrumenting the code is required for the analysis and it has been shown to consume an extra 25% time.
These are run under the sonar
profile.
mvn clean verify -Psonar
And will send static analysis and coverage data to Sonar. See SonarQube-analysis.