Integration Testing with Containers
January 22, 2021 ยท View on GitHub
Virtual Schema integration tests use the exasol-testcontainers framework, which requires docker privileged mode to be available to run the tests.
Overview
The idea of the container based tests is:
- Run the EXASOL and source databases in containers
- Prepare the test schema in the source database
- Create a virtual schema for the source database
- Run the tests on the virtual schema

Prerequisites
What you need is, for each source database:
- A docker image with user you can connect to
- A JDBC driver for the database
Preparing Integration Test
- In order to run the automated integration test, add the
maven-failsafe-pluginto the pom file - Provide a JDBC driver JAR for the source database.
- Add a new Integration Test class for you database
Provide JDBC drivers for the Source Database
The JDBC drivers should be deployed to an Exasol bucket during the test. Create a directory for holding the driver. For example: src/test/resources/integration/driver. The folder should contain the driver jar file(s) and a settings.cfg file. In order to connect to the source database from your integration test you also have to add the jdbc driver dependency to the pom.xml.
Add a new Integration Test Class
Add a new class that has to:
- Create the test schema in the source database
- Create the virtual schema
- Execute the tests on the virtual schema. See PostgreSQLDialectIT for an example.
Security Considerations
In order not to create security issues make sure the data in the source database is not confidential (demo data only).
Executing Integration Tests
We use following Maven life cycle phases for our integration tests:
pre-integration-testphase is used to automatically deploy the latest JDBC adapter JAR (based on your latest code modifications)integration-testphase is used to execute the actual integration tests
Note that to check whether the integration-tests were successful, you have to run the verify Maven phase.
You can start the integration tests as follows:
mvn clean package && mvn verify
Another way to run integration tests:
- Create a package of Virtual Schemas using
mvn packagecommand and run integration tests inside your IDE in the same way as unit tests.