Java library for creating and cleaning up test database structures and contents for integration tests

Test Database Builder Java

Build Status Maven Central – Test Database Builder for Java

Quality Gate Status

Security Rating Reliability Rating Maintainability Rating Technical Debt

Code Smells Coverage Duplicated Lines (%) Lines of Code

Overview

Exasol's Test Database Builder for Java (TDDB) is a library that makes writing integration tests for database applications easier.

The main design goals are to make the code of the integration test compact and readable at the same time.

In a Nutshell

// Precondition: Get a JDBC connection and store it in variable "connection"
final DatabaseObjectFactory factory=new ExasolObjectFactory(connection);
final Schema schema factory.createSchema("ONLINESHOP");
final Table table=schema.createTable("ITEMS","PRODUCT_ID","DECIMAL(18,0)","NAME","VARCHAR(40)")
        .insert("1","Cat food")
        .insert("2","Toy mouse");
final User user=factory.createUser("KIMIKO")
        .grant(CREATE_SESSION)
        .grant(table,SELECT,UDPATE);

For more details, please refer to the user guide.

What it is

This module is designed to be used in test code. It helps you write tests, quickly, easily while still focusing on readability.

What it isn't

TDDB is not suited for production code. We sacrifice speed and features for compactness and ease-of-use. If you are looking for code that helps writing production code, please refer to

Supported Databases

  • Exasol
  • MySQL
  • PostgreSQL

Features

  • Create: schemas, tables, adapter scripts, users, connection definitions, virtual schemas
  • Grant privileges to users
  • Insert data into tables

Customer Support

This is an open source project which is written by enthusiasts at Exasol and not officially supported. We will still try to help you as much as possible. So please create GitHub issue tickets when you want to request features or report bugs.

Table of Contents

Information for Users