Class OrdsContainer

java.lang.Object
org.testcontainers.containers.GenericContainer<OrdsContainer>
com.oracle.spring.testcontainers.OrdsContainer
All Implemented Interfaces:
AutoCloseable, org.testcontainers.containers.Container<OrdsContainer>, org.testcontainers.containers.ContainerState, org.testcontainers.containers.traits.LinkableContainer, org.testcontainers.containers.wait.strategy.WaitStrategyTarget, org.testcontainers.lifecycle.Startable

public class OrdsContainer extends org.testcontainers.containers.GenericContainer<OrdsContainer>
Testcontainers implementation for Oracle REST Data Services (ORDS).

The container requires an Oracle AI Database connection string and administrator password. Schemas registered with withSchema(String, String, String) are REST-enabled after ORDS starts.

  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.testcontainers.containers.Container

    org.testcontainers.containers.Container.ExecResult
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Official ORDS container image.
    static final int
    ORDS HTTP port.
    static final int
    ORDS HTTPS port.
    static final int
    ORDS MongoDB API port.

    Fields inherited from class org.testcontainers.containers.GenericContainer

    CONTAINER_RUNNING_TIMEOUT_SEC, dependencies, dockerClient, INTERNAL_HOST_HOSTNAME, waitStrategy

    Fields inherited from interface org.testcontainers.containers.ContainerState

    STATE_HEALTHY
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a container using the official ORDS image.
    OrdsContainer(String dockerImageName)
    Creates a container using an image name.
    OrdsContainer(org.testcontainers.utility.DockerImageName dockerImageName)
    Creates a container using a parsed image name.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    containerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerInfo)
     
    Returns the mapped ORDS HTTP URL.
    int
    Returns the mapped ORDS HTTP port.
    int
    Returns the mapped ORDS HTTPS port.
    int
    Returns the mapped ORDS MongoDB API port.
    void
     
    Configures the JDBC connection string ORDS uses to install and connect.
    withOraclePassword(String oraclePassword)
    Configures the Oracle AI Database administrator password used by ORDS.
    withSchema(String username, String password, String connectDescriptor)
    Registers a database schema to enable after ORDS starts.

    Methods inherited from class org.testcontainers.containers.GenericContainer

    addEnv, addExposedPort, addExposedPorts, addFileSystemBind, addFixedExposedPort, addFixedExposedPort, addLink, canBeReused, configure, containerIsCreated, containerIsStarted, containerIsStarting, containerIsStarting, containerIsStopped, containerIsStopping, copyFileFromContainer, createVolumeDirectory, dependsOn, dependsOn, dependsOn, doStart, equals, getBinds, getCommandParts, getContainerId, getContainerInfo, getContainerName, getCopyToFileContainerPathMap, getCreateContainerCmdModifiers, getDependencies, getDockerClient, getDockerImageName, getEnv, getEnvMap, getExposedPorts, getExtraHosts, getImage, getIpAddress, getLabels, getLinkedContainers, getLivenessCheckPort, getLivenessCheckPortNumbers, getLivenessCheckPorts, getLogConsumers, getNetwork, getNetworkAliases, getNetworkMode, getPortBindings, getShmSize, getStartupAttempts, getStartupCheckStrategy, getTestHostIpAddress, getTmpFsMapping, getVolumesFroms, getWaitStrategy, getWorkingDirectory, hashCode, isHostAccessible, isPrivilegedMode, isShouldBeReused, logger, setBinds, setCommand, setCommand, setCommandParts, setContainerDef, setCopyToFileContainerPathMap, setDockerImageName, setEnv, setExposedPorts, setExtraHosts, setHostAccessible, setImage, setLabels, setLinkedContainers, setLogConsumers, setNetwork, setNetworkAliases, setNetworkMode, setPortBindings, setPrivilegedMode, setShmSize, setStartupAttempts, setStartupCheckStrategy, setTmpFsMapping, setVolumesFroms, setWaitStrategy, setWorkingDirectory, stop, toString, waitingFor, waitUntilContainerStarted, withAccessToHost, withClasspathResourceMapping, withClasspathResourceMapping, withCommand, withCommand, withCopyFileToContainer, withCopyToContainer, withCreateContainerCmdModifier, withEnv, withEnv, withExposedPorts, withExtraHost, withFileSystemBind, withImagePullPolicy, withLabel, withLabels, withLogConsumer, withMinimumRunningDuration, withNetwork, withNetworkAliases, withNetworkMode, withPrivilegedMode, withReuse, withSharedMemorySize, withStartupAttempts, withStartupCheckStrategy, withStartupTimeout, withTmpFs, withVolumesFrom, withWorkingDirectory

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.testcontainers.containers.Container

    addFileSystemBind, followOutput, followOutput, self, withEnv, withFileSystemBind

    Methods inherited from interface org.testcontainers.containers.ContainerState

    copyFileFromContainer, copyFileToContainer, copyFileToContainer, execInContainer, execInContainer, execInContainer, execInContainer, execInContainerWithUser, execInContainerWithUser, getBoundPortNumbers, getContainerIpAddress, getCurrentContainerInfo, getFirstMappedPort, getHost, getLogs, getLogs, getMappedPort, isCreated, isHealthy, isRunning

    Methods inherited from interface org.testcontainers.lifecycle.Startable

    close
  • Field Details

  • Constructor Details

    • OrdsContainer

      public OrdsContainer()
      Creates a container using the official ORDS image.
    • OrdsContainer

      public OrdsContainer(String dockerImageName)
      Creates a container using an image name.
      Parameters:
      dockerImageName - ORDS image name
    • OrdsContainer

      public OrdsContainer(org.testcontainers.utility.DockerImageName dockerImageName)
      Creates a container using a parsed image name.
      Parameters:
      dockerImageName - ORDS image name
  • Method Details

    • withDatabaseConnectionString

      public OrdsContainer withDatabaseConnectionString(String connectionString)
      Configures the JDBC connection string ORDS uses to install and connect.
      Parameters:
      connectionString - JDBC connection string reachable from the ORDS container
      Returns:
      this container
    • withOraclePassword

      public OrdsContainer withOraclePassword(String oraclePassword)
      Configures the Oracle AI Database administrator password used by ORDS.
      Parameters:
      oraclePassword - administrator password
      Returns:
      this container
    • withSchema

      public OrdsContainer withSchema(String username, String password, String connectDescriptor)
      Registers a database schema to enable after ORDS starts.
      Parameters:
      username - schema username
      password - schema password
      connectDescriptor - database connection descriptor reachable from the ORDS container
      Returns:
      this container
    • getBaseUrl

      public String getBaseUrl()
      Returns the mapped ORDS HTTP URL.
      Returns:
      base HTTP URL
    • getHttpPort

      public int getHttpPort()
      Returns the mapped ORDS HTTP port.
      Returns:
      HTTP port
    • getHttpsPort

      public int getHttpsPort()
      Returns the mapped ORDS HTTPS port.
      Returns:
      HTTPS port
    • getMongoDbApiPort

      public int getMongoDbApiPort()
      Returns the mapped ORDS MongoDB API port.
      Returns:
      MongoDB API port
    • start

      public void start()
      Specified by:
      start in interface org.testcontainers.lifecycle.Startable
      Overrides:
      start in class org.testcontainers.containers.GenericContainer<OrdsContainer>
    • containerIsStarted

      protected void containerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerInfo)
      Overrides:
      containerIsStarted in class org.testcontainers.containers.GenericContainer<OrdsContainer>