Software testing

JUnit logo Testcontainers logo

Testing Java applications against CrateDB.

JUnit

The popular JUnit framework is supported by CrateDB Java Testing Classes. The package includes CrateTestServer and CrateTestCluster classes for use as JUnit external resources. Both classes download and start CrateDB before test execution, and stop CrateDB afterward.

Package:

io.crate:crate-testing:0.12.1

Download:

io.crate:crate-testing (Maven Central)

Repository:

crate-java-testing

CI status:

Java: JDBC, QA

Using JUnit “crate-testing” with CrateDB

This example project uses the io.crate:crate-testing package and includes a corresponding project setup that you can use right away to get started.

https://github.com/crate/cratedb-examples/tree/main/by-language/java-qa

Testcontainers

Testcontainers is an open-source framework for providing throwaway, lightweight instances of databases, message brokers, web browsers, or just about anything that can run in a Docker container. CrateDB provides Testcontainers implementations for both Java and Python which are using its OCI container image.

Package:

org.testcontainers:testcontainers-cratedb:2.0.1

Download:

org.testcontainers:testcontainers-cratedb (Maven Central)

Repository:

testcontainers-cratedb sources

Documentation:

Testcontainers CrateDB Module

CI status:

Testcontainers for Java

Using “Testcontainers for Java” with CrateDB

This example project uses the testcontainers-cratedb package and includes a corresponding project setup that you can use right away to get started.

https://github.com/crate/cratedb-examples/tree/main/testing/testcontainers/java