Skip to content

Commit d069a85

Browse files
committed
Testcontainers/Java: Don't tag the CrateDB JDBC driver as "legacy"
1 parent b35f2ef commit d069a85

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

testing/testcontainers/java/README.rst

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ of examples you can explore here:
3333
- ``TestFunctionScope``: Function-scoped testcontainer instance with automatic setup/teardown, see `Restarted containers`_.
3434
- ``TestJdbcUrlScheme``: Database containers launched via Testcontainers "TC" JDBC URL scheme.
3535
- ``TestManual``: Function-scoped testcontainer instance with manual setup/teardown.
36-
- ``TestManualWithLegacyCrateJdbcDriver``:
36+
- ``TestManualWithCrateDBJdbcDriver``:
3737
Function-scoped testcontainer instance with manual setup/teardown, using a custom
38-
``CrateDBContainer``, which uses the `legacy CrateDB JDBC driver`_.
38+
``CrateDBContainer``, which uses the `CrateDB JDBC driver`_.
3939
- ``TestSharedSingleton``:
4040
Testcontainer instance shared across multiple test classes, implemented using the Singleton pattern, see `Singleton containers`_.
4141
- ``TestSharedSingletonEnvironmentVersion``:
@@ -45,6 +45,8 @@ of examples you can explore here:
4545
- ``TestSqlInitialization``: Demonstrate different ways how Testcontainers can run an init script after
4646
the database container is started, but before your code initiates a connection to it.
4747

48+
Unless otherwise noted, all examples use the `PostgreSQL JDBC driver`_ for
49+
connecting to CrateDB.
4850

4951
*****
5052
Usage
@@ -74,15 +76,16 @@ Usage
7476
docker run -it --rm --publish=4200:4200 --publish=5432:5432 \
7577
crate:latest -Cdiscovery.type=single-node
7678

77-
# Run example program, using both the CrateDB legacy
78-
# JDBC driver, and the vanilla PostgreSQL JDBC driver.
79+
# Run example program, using both the CrateDB JDBC driver,
80+
# and the vanilla PostgreSQL JDBC driver.
7981
./gradlew run --args="jdbc:crate://localhost:5432/"
8082
./gradlew run --args="jdbc:postgresql://localhost:5432/"
8183

8284

8385
.. _CrateDB: https://github.com/crate/crate
86+
.. _CrateDB JDBC driver: https://cratedb.com/docs/guide/connect/java/cratedb-jdbc.html
8487
.. _CrateDB OCI image: https://hub.docker.com/_/crate
85-
.. _legacy CrateDB JDBC driver: https://crate.io/docs/jdbc/
88+
.. _PostgreSQL JDBC driver: https://cratedb.com/docs/guide/connect/java/postgresql-jdbc.html
8689
.. _Restarted containers: https://java.testcontainers.org/test_framework_integration/junit_5/#restarted-containers
8790
.. _Shared containers: https://java.testcontainers.org/test_framework_integration/junit_5/#shared-containers
8891
.. _Singleton containers: https://java.testcontainers.org/test_framework_integration/manual_lifecycle_control/#singleton-containers
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@
1414

1515
/**
1616
* Function-scoped testcontainer instance with manual setup/teardown, using a custom CrateDBContainer which uses
17-
* the <a href="https://crate.io/docs/jdbc/en/latest/index.html">legacy CrateDB JDBC driver</a>.
17+
* the <a href="https://cratedb.com/docs/guide/connect/java/cratedb-jdbc.html">CrateDB JDBC driver</a>.
1818
* <a href="https://www.testcontainers.org/test_framework_integration/junit_4/#manually-controlling-container-lifecycle" />
1919
*/
20-
public class TestManualWithLegacyCrateJdbcDriver {
20+
public class TestManualWithCrateDBJdbcDriver {
2121

2222
@Test
2323
public void testReadSummits() throws SQLException, IOException {
2424
// Run CrateDB nightly.
2525
DockerImageName image = TestingHelpers.nameFromLabel("nightly");
26-
try (CrateDBContainerLegacyJdbcDriver cratedb = new CrateDBContainerLegacyJdbcDriver(image)) {
26+
try (CrateDBContainerJdbcDriver cratedb = new CrateDBContainerJdbcDriver(image)) {
2727
cratedb.start();
2828

2929
// Get JDBC URL to CrateDB instance.
@@ -40,7 +40,7 @@ public void testReadSummits() throws SQLException, IOException {
4040
}
4141
}
4242

43-
static class CrateDBContainerLegacyJdbcDriver extends JdbcDatabaseContainer<CrateDBContainerLegacyJdbcDriver> {
43+
static class CrateDBContainerJdbcDriver extends JdbcDatabaseContainer<CrateDBContainerJdbcDriver> {
4444

4545
public static final String IMAGE = "crate";
4646

@@ -52,7 +52,7 @@ static class CrateDBContainerLegacyJdbcDriver extends JdbcDatabaseContainer<Crat
5252

5353
private String password = "crate";
5454

55-
public CrateDBContainerLegacyJdbcDriver(final DockerImageName dockerImageName) {
55+
public CrateDBContainerJdbcDriver(final DockerImageName dockerImageName) {
5656
super(dockerImageName);
5757
dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME);
5858

@@ -100,19 +100,19 @@ public String getTestQueryString() {
100100
}
101101

102102
@Override
103-
public CrateDBContainerLegacyJdbcDriver withDatabaseName(final String databaseName) {
103+
public CrateDBContainerJdbcDriver withDatabaseName(final String databaseName) {
104104
this.databaseName = databaseName;
105105
return self();
106106
}
107107

108108
@Override
109-
public CrateDBContainerLegacyJdbcDriver withUsername(final String username) {
109+
public CrateDBContainerJdbcDriver withUsername(final String username) {
110110
this.username = username;
111111
return self();
112112
}
113113

114114
@Override
115-
public CrateDBContainerLegacyJdbcDriver withPassword(final String password) {
115+
public CrateDBContainerJdbcDriver withPassword(final String password) {
116116
this.password = password;
117117
return self();
118118
}

0 commit comments

Comments
 (0)