Skip to content

Commit 39dd4b7

Browse files
committed
Testcontainers for Java: Update software versions
Use CrateDB 5.10 and PostgreSQL 17.
1 parent 90c40d0 commit 39dd4b7

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

testing/testcontainers/java/README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ Usage
7070
./gradlew test --tests TestFunctionScope --info
7171

7272
# Run test case showing how to select CrateDB version per environment variable.
73-
export CRATEDB_VERSION=5.2.3
73+
export CRATEDB_VERSION=5.10.3
7474
export CRATEDB_VERSION=nightly
75-
./gradlew test --tests TestSharedSingletonMatrix
75+
./gradlew test --tests TestSqlInitialization
7676

7777
3. Invoke example application::
7878

testing/testcontainers/java/src/test/java/io/crate/example/testing/TestClassScope.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
public class TestClassScope {
2727

2828
@ClassRule
29-
public static CrateDBContainer cratedb = new CrateDBContainer(TestingHelpers.nameFromLabel("5.2"));
29+
public static CrateDBContainer cratedb = new CrateDBContainer(TestingHelpers.nameFromLabel("5.10"));
3030

3131
@Test
3232
public void testReadSummits() throws SQLException, IOException {

testing/testcontainers/java/src/test/java/io/crate/example/testing/TestFunctionScope.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
public class TestFunctionScope {
2727

2828
@Rule
29-
public CrateDBContainer cratedb = new CrateDBContainer(TestingHelpers.nameFromLabel("5.2"));
29+
public CrateDBContainer cratedb = new CrateDBContainer(TestingHelpers.nameFromLabel("5.10"));
3030

3131
@Test
3232
public void testReadSummits() throws SQLException, IOException {

testing/testcontainers/java/src/test/java/io/crate/example/testing/TestJdbcUrlScheme.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
public class TestJdbcUrlScheme {
2020

2121
/**
22-
* Launch container with PostgreSQL 15.
22+
* Launch container with PostgreSQL.
2323
*/
2424
@Test
2525
public void testReadSummitsPostgreSQL() throws SQLException, IOException {
26-
String connectionUrl = "jdbc:tc:postgresql:15:///";
26+
String connectionUrl = "jdbc:tc:postgresql:17:///";
2727
System.out.printf("Connecting to %s%n", connectionUrl);
2828

2929
// Invoke example query.
@@ -32,13 +32,13 @@ public void testReadSummitsPostgreSQL() throws SQLException, IOException {
3232
}
3333

3434
/**
35-
* Launch container with CrateDB 5.2.
35+
* Launch container with CrateDB.
3636
*/
3737
@Test
3838
public void testReadSummitsCrateDB() throws SQLException, IOException {
3939
// NOTE: Please note `jdbc:tc:crate` will not work, only `jdbc:tc:cratedb`.
4040
// => `java.lang.UnsupportedOperationException: Database name crate not supported`
41-
String connectionUrl = "jdbc:tc:cratedb:5.2://localhost/doc?user=crate";
41+
String connectionUrl = "jdbc:tc:cratedb:5.10://localhost/doc?user=crate";
4242
System.out.printf("Connecting to %s%n", connectionUrl);
4343

4444
// Invoke example query.
@@ -48,12 +48,12 @@ public void testReadSummitsCrateDB() throws SQLException, IOException {
4848
}
4949

5050
/**
51-
* Launch container with CrateDB 5.2, using daemon mode.
51+
* Launch container with CrateDB, using daemon mode.
5252
* <a href="https://www.testcontainers.org/modules/databases/jdbc/#running-container-in-daemon-mode"/>
5353
*/
5454
@Test
5555
public void testReadSummitsCrateDBWithDaemon() throws SQLException, IOException {
56-
String connectionUrl = "jdbc:tc:cratedb:5.2://localhost/doc?user=crate&TC_DAEMON=true";
56+
String connectionUrl = "jdbc:tc:cratedb:5.10://localhost/doc?user=crate&TC_DAEMON=true";
5757
System.out.printf("Connecting to %s%n", connectionUrl);
5858

5959
// Invoke example query.
@@ -63,12 +63,12 @@ public void testReadSummitsCrateDBWithDaemon() throws SQLException, IOException
6363
}
6464

6565
/**
66-
* Launch container with CrateDB 5.2, using "Reusable Containers (Experimental)".
66+
* Launch container with CrateDB, using "Reusable Containers (Experimental)".
6767
* <a href="https://www.testcontainers.org/features/reuse/"/>
6868
*/
6969
@Test
7070
public void testReadSummitsCrateDBWithReuse() throws SQLException, IOException {
71-
String connectionUrl = "jdbc:tc:cratedb:5.2://localhost/doc?user=crate&TC_REUSABLE=true";
71+
String connectionUrl = "jdbc:tc:cratedb:5.10://localhost/doc?user=crate&TC_REUSABLE=true";
7272
System.out.printf("Connecting to %s%n", connectionUrl);
7373

7474
// Invoke example query.

testing/testcontainers/java/src/test/java/io/crate/example/testing/TestSqlInitialization.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
public class TestSqlInitialization {
1919

2020
/**
21-
* Launch container with CrateDB 5.2, using `TC_INITSCRIPT` to address a file in Java's CLASSPATH.
21+
* Launch container with CrateDB, using `TC_INITSCRIPT` to address a file in Java's CLASSPATH.
2222
* <a href="https://www.testcontainers.org/modules/databases/jdbc/#using-a-classpath-init-script"/>
2323
*/
2424
@Test
2525
public void testTcInitClasspathFile() throws SQLException, IOException {
26-
String connectionUrl = "jdbc:tc:cratedb:5.2://localhost/doc?user=crate&TC_REUSABLE=true&TC_INITSCRIPT=init.sql";
26+
String connectionUrl = "jdbc:tc:cratedb:5.10://localhost/doc?user=crate&TC_REUSABLE=true&TC_INITSCRIPT=init.sql";
2727
System.out.printf("Connecting to %s%n", connectionUrl);
2828

2929
// Invoke `SHOW CREATE TABLE ...` query.
@@ -34,12 +34,12 @@ public void testTcInitClasspathFile() throws SQLException, IOException {
3434
}
3535

3636
/**
37-
* Launch container with CrateDB 5.2, using `TC_INITSCRIPT` to address an arbitrary file on the filesystem.
37+
* Launch container with CrateDB, using `TC_INITSCRIPT` to address an arbitrary file on the filesystem.
3838
* <a href="https://www.testcontainers.org/modules/databases/jdbc/#using-an-init-script-from-a-file"/>
3939
*/
4040
@Test
4141
public void testTcInitArbitraryFile() throws SQLException, IOException {
42-
String connectionUrl = "jdbc:tc:cratedb:5.2://localhost/doc?user=crate&TC_REUSABLE=true&TC_INITSCRIPT=file:src/test/resources/init.sql";
42+
String connectionUrl = "jdbc:tc:cratedb:5.10://localhost/doc?user=crate&TC_REUSABLE=true&TC_INITSCRIPT=file:src/test/resources/init.sql";
4343
System.out.printf("Connecting to %s%n", connectionUrl);
4444

4545
// Invoke `SHOW CREATE TABLE ...` query.
@@ -50,12 +50,12 @@ public void testTcInitArbitraryFile() throws SQLException, IOException {
5050
}
5151

5252
/**
53-
* Launch container with CrateDB 5.2, using an init function.
53+
* Launch container with CrateDB, using an init function.
5454
* <a href="https://www.testcontainers.org/modules/databases/jdbc/#using-an-init-script-from-a-file"/>
5555
*/
5656
@Test
5757
public void testTcInitFunction() throws SQLException, IOException {
58-
String connectionUrl = "jdbc:tc:cratedb:5.2://localhost/doc?user=crate&TC_INITFUNCTION=io.crate.example.testing.utils.TestingHelpers::sqlInitFunction";
58+
String connectionUrl = "jdbc:tc:cratedb:5.10://localhost/doc?user=crate&TC_INITFUNCTION=io.crate.example.testing.utils.TestingHelpers::sqlInitFunction";
5959
System.out.printf("Connecting to %s%n", connectionUrl);
6060

6161
// Invoke `SHOW CREATE TABLE ...` query.

0 commit comments

Comments
 (0)