A Testcontainers module for running CUBRID in JAVA integration tests.
dependencies {
testImplementation 'org.cubrid:testcontainers-cubrid:0.1.0'
testRuntimeOnly 'org.cubrid:cubrid-jdbc:11.3.2.0053'
}<dependency>
<groupId>org.cubrid</groupId>
<artifactId>testcontainers-cubrid</artifactId>
<version>0.1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.cubrid</groupId>
<artifactId>cubrid-jdbc</artifactId>
<version>11.3.2.0053</version>
<scope>test</scope>
</dependency>import org.testcontainers.cubrid.CubridContainer;
try (CubridContainer cubrid = new CubridContainer("cubrid/cubrid:11.4")) {
cubrid.start();
try (Connection conn = DriverManager.getConnection(
cubrid.getJdbcUrl(), cubrid.getUsername(), cubrid.getPassword());
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT 1")) {
// ...
}
}Testcontainers starts and stops the container based on the URL:
String url = "jdbc:tc:cubrid:11.4://localhost/mydb";
try (Connection conn = DriverManager.getConnection(url)) {
// ...
}| Method | Default | Description |
|---|---|---|
withDatabaseName(String) |
testdb |
Database name to create on startup. |
withUsername(String) |
testuser |
Application user. Cannot be dba or public (CUBRID reserved). |
withPassword(String) |
testpass |
Password for the application user. May be empty; must not be null. |
withInitScript(String) |
— | Classpath resource SQL script run after the container is ready. |
withUrlParam(String, String) |
— | Additional JDBC URL parameter. |
The container exposes broker port 33000. Use getJdbcUrl() for the mapped URL or getMappedPort(33000) for the port number.
- Java 8+ (the module is published targeting Java 8 bytecode)
- Docker
- CUBRID image:
cubrid/cubrid withUsername()does not acceptdbaorpublic. Those accounts already exist in CUBRID by default; pick any other name and the container will create that user with the password fromwithPassword().
Requirements: JDK 17 and Docker.
./gradlew buildMIT — Copyright (c) 2026 CUBRID RDBMS