-
Notifications
You must be signed in to change notification settings - Fork 9
Testing and Build
Jin Kwon edited this page Jun 29, 2026
·
4 revisions
./mvnw clean testMain sources compile for Java 11. Tests are configured for Java 25 in the current source tree.
Surefire excludes *IT.java by default. The regular test suite includes model tests and in-memory database tests.
In-memory database coverage in the checked-out source includes:
| Database | Test class | JDBC URL |
|---|---|---|
| Derby | Memory_Derby_Test |
jdbc:derby:memory:test |
| H2 | Memory_H2_Test |
jdbc:h2:mem:test |
| HSQLDB | Memory_Hsql_Test |
jdbc:hsqldb:mem:test |
| SQLite | Memory_Sqlite_Test |
jdbc:sqlite::memory: |
Integration tests are run through the failsafe profile.
./mvnw -Pfailsafe verifyTo run the generic external database integration test, pass a JDBC URL, user, and password.
./mvnw \
-Pfailsafe \
-Dit.test=ExternalIT \
-Durl='jdbc:...' \
-Duser='...' \
-Dpassword='...' \
clean test-compile failsafe:integration-testThe external tests also accept a catalog system property in the test source.
The project defines separate profiles that add Testcontainers dependencies and test source directories.
| Profile | Adds tests from |
|---|---|
testcontainers |
src/test/java-testcontainers |
testcontainers-db2 |
src/test/java-testcontainers-db2 |
testcontainers-mariadb |
src/test/java-testcontainers-mariadb |
testcontainers-mssqlserver |
src/test/java-testcontainers-mssqlserver |
testcontainers-mysql |
src/test/java-testcontainers-mysql |
testcontainers-oracle-free |
src/test/java-testcontainers-oracle-free |
testcontainers-oracle-xe |
src/test/java-testcontainers-oracle-xe |
testcontainers-postgresql |
src/test/java-testcontainers-postgresql |
Example:
./mvnw -Pfailsafe,testcontainers,testcontainers-postgresql verify| Database | Image |
|---|---|
| DB2 | ibmcom/db2:latest |
| MariaDB | mariadb:latest |
| MySQL | mysql:8 |
| Oracle Free | container-registry.oracle.com/database/free:latest-lite |
| Oracle XE | gvenzl/oracle-xe:latest-faststart |
| PostgreSQL | postgres:latest |
| SQL Server | mcr.microsoft.com/mssql/server:2022-latest |
Docker must be available for Testcontainers profiles.
The Maven build configures:
- Error Prone and NullAway as compiler annotation processors;
- JSpecify annotations for nullness;
- JaCoCo report generation;
- Maven Javadoc, JXR, Checkstyle, and PMD reporting plugins;
- Apache License 2.0 checks through
license-maven-plugin.