Skip to content

Commit e2a7508

Browse files
committed
Switch to Testcontainers Oracle Free.
Timeout increased from the default because that cause problems on CI. Brought SD JDBC now uses `ojdbc11` as R2DBC. Closes #1665 Original pull request #1668
1 parent 126781f commit e2a7508

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

spring-data-jdbc/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148

149149
<dependency>
150150
<groupId>com.oracle.database.jdbc</groupId>
151-
<artifactId>ojdbc8</artifactId>
151+
<artifactId>ojdbc11</artifactId>
152152
<version>${oracle.version}</version>
153153
<scope>test</scope>
154154
</dependency>
@@ -229,7 +229,7 @@
229229

230230
<dependency>
231231
<groupId>org.testcontainers</groupId>
232-
<artifactId>oracle-xe</artifactId>
232+
<artifactId>oracle-free</artifactId>
233233
<scope>test</scope>
234234
</dependency>
235235

spring-data-jdbc/src/test/java/org/springframework/data/jdbc/testing/OracleDataSourceConfiguration.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import org.springframework.jdbc.core.JdbcTemplate;
2525
import org.springframework.jdbc.datasource.DriverManagerDataSource;
2626
import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator;
27-
import org.testcontainers.containers.OracleContainer;
27+
import org.testcontainers.oracle.OracleContainer;
2828
import org.testcontainers.utility.DockerImageName;
2929

3030
/**
@@ -55,10 +55,9 @@ protected DataSource createDataSource() {
5555
if (ORACLE_CONTAINER == null) {
5656

5757
LOG.info("Oracle starting...");
58-
DockerImageName dockerImageName = DockerImageName.parse("gvenzl/oracle-free:23-slim")
59-
.asCompatibleSubstituteFor("gvenzl/oracle-xe");
60-
OracleContainer container = new OracleContainer(dockerImageName)
61-
.withDatabaseName("freepdb2")
58+
DockerImageName dockerImageName = DockerImageName.parse("gvenzl/oracle-free:23.3-slim");
59+
OracleContainer container = new OracleContainer(dockerImageName) //
60+
.withStartupTimeoutSeconds(200) //
6261
.withReuse(true);
6362
container.start();
6463
LOG.info("Oracle started");

spring-data-r2dbc/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@
285285

286286
<dependency>
287287
<groupId>org.testcontainers</groupId>
288-
<artifactId>oracle-xe</artifactId>
288+
<artifactId>oracle-free</artifactId>
289289
<scope>test</scope>
290290
</dependency>
291291

spring-data-r2dbc/src/test/java/org/springframework/data/r2dbc/testing/OracleTestSupport.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import org.springframework.jdbc.core.JdbcTemplate;
3030
import org.springframework.jdbc.datasource.DriverManagerDataSource;
3131
import org.springframework.util.ClassUtils;
32-
import org.testcontainers.containers.OracleContainer;
32+
import org.testcontainers.oracle.OracleContainer;
3333

3434
/**
3535
* Utility class for testing against Oracle.
@@ -128,7 +128,9 @@ private static ExternalDatabase testContainer() {
128128
if (testContainerDatabase == null) {
129129

130130
try {
131-
OracleContainer container = new OracleContainer("gvenzl/oracle-xe:21.3.0-slim").withReuse(true);
131+
OracleContainer container = new OracleContainer("23.3-slim") //
132+
.withReuse(true) //
133+
.withStartupTimeoutSeconds(200); // the default of 60s isn't sufficient
132134
container.start();
133135

134136
testContainerDatabase = ProvidedDatabase.builder(container) //

0 commit comments

Comments
 (0)