Skip to content

Commit

Permalink
Use oracle-free from testcontainers
Browse files Browse the repository at this point in the history
This uses gvenzel's minimizeds containers, but also works with upstream
oracle. commons-lang is no longer needed.

This also bumps PostgreSQL from 13 to 15.
  • Loading branch information
ecki committed Nov 28, 2023
1 parent 65e44e9 commit c871cf9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 237 deletions.
9 changes: 1 addition & 8 deletions tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@
</properties>

<dependencies>
<!-- Required as long as OraceFreeContainer is not in testcontainers-java -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.13.0</version>
<scope>test</scope>
</dependency>
<!-- testcontainer/docker has conflicting versions -->
<dependency>
<artifactId>slf4j-api</artifactId>
Expand All @@ -45,7 +38,7 @@
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>oracle-xe</artifactId>
<artifactId>oracle-free</artifactId>
<version>${version.testcontainers}</version>
<scope>test</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.testcontainers.containers.Container.ExecResult;
import org.testcontainers.utility.DockerImageName;
import org.testcontainers.utility.MountableFile;
import org.testcontainers.containers.OracleFreeContainer;
import org.testcontainers.oracle.OracleContainer;

/**
* Testing the installation/systemdatabase/oracle/*.sql DDL scripts
Expand All @@ -38,17 +39,20 @@ class OracleTests
{
static final private String BASE = "../installation/systemdatabase/oracle/";

static OracleFreeContainer dbContainer = null;
static OracleContainer dbContainer = null;

@BeforeAll
static void setUpBeforeClass()
throws Exception
{
System.out.println("Starting container...");

// https://container-registry.oracle.com/ords/
// DockerImageName name = DockerImageName.parse("container-registry.oracle.com/database/free:23.3.0.0").asCompatibleSubstituteFor("gvenzl/oracle-free");
DockerImageName name = DockerImageName.parse("gvenzl/oracle-free:latest");

// we do this here to not hide the fail reason in Initializer Exception
//DockerImageName name = DockerImageName.parse("container-registry.oracle.com/database/free:latest").asCompatibleSubstituteFor("gvenzl/oracle-xe");
dbContainer = new OracleFreeContainer();
dbContainer = new OracleContainer(name);

dbContainer.start();
System.out.println("done.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ static void setUpBeforeClass()
System.out.println("Starting container...");

// we do this here to not hide the fail reason in Initializer Exception
//DockerImageName name = DockerImageName.parse("postgres:13");
dbContainer = new PostgreSQLContainer<>(DockerImageName.parse("postgres:13"));
dbContainer = new PostgreSQLContainer<>(DockerImageName.parse("postgres:15"));

dbContainer.start();
System.out.println("done.");
Expand Down

This file was deleted.

0 comments on commit c871cf9

Please sign in to comment.