Skip to content

Commit 9cf94ce

Browse files
SanneDavideD
authored andcommitted
Update integration tests to use Oracle container image 23.2.0-faststart
1 parent 06674c8 commit 9cf94ce

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

hibernate-reactive-core/src/test/java/org/hibernate/reactive/containers/OracleDatabase.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,19 +84,32 @@ class OracleDatabase implements TestableDatabase {
8484
}
8585
}
8686

87-
public static final OracleContainer oracle = new OracleContainer( imageName( "gvenzl/oracle-xe", "21-slim-faststart" ) )
87+
public static final OracleContainer oracle = new OracleContainer(
88+
imageName( "gvenzl/oracle-free", "23.2.0-faststart" )
89+
.asCompatibleSubstituteFor( "gvenzl/oracle-xe" ) )
8890
.withUsername( DatabaseConfiguration.USERNAME )
8991
.withPassword( DatabaseConfiguration.PASSWORD )
9092
.withDatabaseName( DatabaseConfiguration.DB_NAME )
91-
.withLogConsumer( of -> System.out.println( of.getUtf8String() ) )
93+
.withLogConsumer( of -> logContainerOutput( of.getUtf8String() ) )
9294
.withReuse( true )
95+
.withStartupAttempts( 1 )
9396

9497
// We need to limit the maximum amount of CPUs being used by the container;
9598
// otherwise the hardcoded memory configuration of the DB might not be enough to successfully boot it.
9699
// See https://github.com/gvenzl/oci-oracle-xe/issues/64
97100
// I choose to limit it to "2 cpus": should be more than enough for any local testing needs,
98101
// and keeps things simple.
99102
.withCreateContainerCmdModifier( cmd -> cmd.getHostConfig().withCpuCount( 2L ) );
103+
;
104+
105+
private static void logContainerOutput(String line) {
106+
System.out.print( line );
107+
}
108+
109+
//Start the container only - useful for testing and CLI
110+
public static void main(String[] args) {
111+
oracle.start();
112+
}
100113

101114
@Override
102115
public String getJdbcUrl() {

podman.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,5 +206,5 @@ and schema to run the tests:
206206
[oracle]:https://www.oracle.com/database/technologies/appdev/xe.html
207207

208208
```
209-
podman run --rm --name HibernateTestingOracle -e ORACLE_PASSWORD=hreact -e APP_USER=hreact -e APP_USER_PASSWORD=hreact -e ORACLE_DATABASE=hreact -p 1521:1521 docker.io/gvenzl/oracle-xe:21-slim-faststart
209+
podman run --rm --name HibernateTestingOracle -e ORACLE_PASSWORD=hreact -e APP_USER=hreact -e APP_USER_PASSWORD=hreact -e ORACLE_DATABASE=hreact -p 1521:1521 docker.io/gvenzl/oracle-free:23.2.0-faststart
210210
```

0 commit comments

Comments
 (0)