https://github.com/exasol/exasol-test-setup-abstraction-java
Common interface for testing with an Exasol database in local and AWS environments using Java.
https://github.com/exasol/exasol-test-setup-abstraction-java
exasol-integration integration-testing testing
Last synced: 3 months ago
JSON representation
Common interface for testing with an Exasol database in local and AWS environments using Java.
- Host: GitHub
- URL: https://github.com/exasol/exasol-test-setup-abstraction-java
- Owner: exasol
- License: mit
- Created: 2021-04-06T08:08:53.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-05-22T07:26:11.000Z (almost 2 years ago)
- Last Synced: 2024-05-22T13:37:46.462Z (almost 2 years ago)
- Topics: exasol-integration, integration-testing, testing
- Language: Java
- Homepage:
- Size: 336 KB
- Stars: 1
- Watchers: 8
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Exasol Test Setup Abstraction
[](https://github.com/exasol/exasol-test-setup-abstraction-java/actions/workflows/ci-build.yml)
[](https://search.maven.org/artifact/com.exasol/exasol-test-setup-abstraction-java)
[](https://sonarcloud.io/dashboard?id=com.exasol%3Aexasol-test-setup-abstraction-java)
[](https://sonarcloud.io/dashboard?id=com.exasol%3Aexasol-test-setup-abstraction-java)
[](https://sonarcloud.io/dashboard?id=com.exasol%3Aexasol-test-setup-abstraction-java)
[](https://sonarcloud.io/dashboard?id=com.exasol%3Aexasol-test-setup-abstraction-java)
[](https://sonarcloud.io/dashboard?id=com.exasol%3Aexasol-test-setup-abstraction-java)
[](https://sonarcloud.io/dashboard?id=com.exasol%3Aexasol-test-setup-abstraction-java)
[](https://sonarcloud.io/dashboard?id=com.exasol%3Aexasol-test-setup-abstraction-java)
[](https://sonarcloud.io/dashboard?id=com.exasol%3Aexasol-test-setup-abstraction-java)
[](https://sonarcloud.io/dashboard?id=com.exasol%3Aexasol-test-setup-abstraction-java)
This repository defines a standardized interface for accessing an Exasol database for testing.
That allows you to write tests where you can switch the test-backend. For example you can switch between an Exasol cluster in the cloud or a local docker-db.
In addition, it contains implementations for this interface for the following test-backends:
* Local - Docker (via Testcontainers)
* With an Exasol cluster on AWS
## Usage
```java
class MyTest {
private static final ExasolTestSetup EXASOL = new ExasolTestSetupFactory("cloudSetup/generated/testConfig.json").getTestSetup();
@Test
void test() {
var sqlConnection = EXASOL.createConnection();
//...
}
@AfterAll
static void afterAll() {
EXASOL.close();
}
}
```
The `ExasolTestSetupFactory` in the example returns a test setup for an AWS cluster if the specified config file (`cloudSetup/generated/testConfig.json`) exists. Otherwise, it returns a test setup based on a local running Exasol-Testcontainer.
Usually you generate the `testConfig.json` using the Terraform module [terraform-aws-exasol-test-setup >= 1.0.0](https://github.com/exasol/terraform-aws-exasol-test-setup/). For details see the [guide for setting up a project with cloud resources](doc/user_guide/setup_project_with_cloud_resources.md).
You can also select a specific test-setup in code. For that simply replace `new ExasolTestSetupFactory().getTestSetup()` by `new ExasolTestcontainerTestSetup()`.
To change the Exasol Docker DB version being used you can define the `com.exasol.dockerdb.image` system property, e.g: `mvn verify -Dcom.exasol.dockerdb.image=${{ matrix.docker_db_version }}`.
## Information for Users of This Library
* [Guide for Setting up a Project With Cloud Resources](doc/user_guide/setup_project_with_cloud_resources.md)
* [Changelog](doc/changes/changelog.md)
## Information for Developers of This Library
* [Developer Guide](doc/developer_guide/developer_guide.md)
* [Dependencies](dependencies.md)