Class OracleFreeContainer<SELF extends OracleFreeContainer<SELF>>

java.lang.Object
org.testcontainers.containers.GenericContainer<SELF>
org.testcontainers.containers.JdbcDatabaseContainer<SELF>
com.oracle.spring.testcontainers.OracleFreeContainer<SELF>
Type Parameters:
SELF - concrete container type
All Implemented Interfaces:
AutoCloseable, org.testcontainers.containers.Container<SELF>, org.testcontainers.containers.ContainerState, org.testcontainers.containers.traits.LinkableContainer, org.testcontainers.containers.wait.strategy.WaitStrategyTarget, org.testcontainers.lifecycle.Startable
Direct Known Subclasses:
OracleContainer, TrueCacheContainer

public abstract class OracleFreeContainer<SELF extends OracleFreeContainer<SELF>> extends org.testcontainers.containers.JdbcDatabaseContainer<SELF>
Common Testcontainers support for the official Oracle AI Database Free image.

This class deliberately contains only image and credential mechanics shared by a primary database and a True Cache instance. Database-specific startup and JDBC policy remains in the concrete containers.

  • Nested Class Summary

    Nested classes/interfaces inherited from class org.testcontainers.containers.JdbcDatabaseContainer

    org.testcontainers.containers.JdbcDatabaseContainer.NoDriverFoundException

    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
    Default pluggable database service name.
    static final String
    Default administrator password used by the test containers.
    static final String
    Default container database SID.
    static final String
    Official Oracle AI Database Free container image.
    protected static final String
     
    static final int
    Oracle listener port.

    Fields inherited from class org.testcontainers.containers.JdbcDatabaseContainer

    parameters, urlParameters

    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
    Modifier
    Constructor
    Description
    protected
    OracleFreeContainer(org.testcontainers.utility.DockerImageName dockerImageName)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
     
     
    Returns the mapped Oracle listener port.
     
    protected String
     
    protected final boolean
     
    protected static boolean
     
    protected static String
     
    protected static void
     
    protected static void
     
    protected static void
     
    protected void
     
    Sets the administrative password passed to the image through ORACLE_PWD.
    withArchiveLog(boolean enabled)
    Enables or disables archive logging.
    withForceLogging(boolean enabled)
    Enables or disables force logging.
    Supplies the image credentials as files beneath /run/secrets.
    withPassword(String password)
    Sets the administrator password used by a container without an application-user mode.

    Methods inherited from class org.testcontainers.containers.JdbcDatabaseContainer

    addParameter, constructUrlForConnection, constructUrlParameters, constructUrlParameters, containerIsStarted, createConnection, createConnection, getConnectTimeoutSeconds, getDatabaseDelegate, getDatabaseName, getJdbcDriverInstance, getJdbcUrl, getStartupTimeoutSeconds, getUsername, optionallyMapResourceParameterAsVolume, optionallyMapResourceParameterAsVolume, runInitScriptIfRequired, setParameters, withConnectTimeoutSeconds, withDatabaseName, withInitScript, withInitScripts, withInitScripts, withStartupTimeoutSeconds, withUrlParam, withUsername

    Methods inherited from class org.testcontainers.containers.GenericContainer

    addEnv, addExposedPort, addExposedPorts, addFileSystemBind, addFixedExposedPort, addFixedExposedPort, addLink, canBeReused, 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, 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, start, stop, toString, waitingFor, 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.containers.traits.LinkableContainer

    getContainerName

    Methods inherited from interface org.testcontainers.lifecycle.Startable

    close
  • Field Details

  • Constructor Details

    • OracleFreeContainer

      protected OracleFreeContainer(org.testcontainers.utility.DockerImageName dockerImageName)
  • Method Details

    • withAdminPassword

      public SELF withAdminPassword(String password)
      Sets the administrative password passed to the image through ORACLE_PWD.
      Parameters:
      password - administrative password
      Returns:
      this container
    • withPassword

      public SELF withPassword(String password)
      Sets the administrator password used by a container without an application-user mode.
      Overrides:
      withPassword in class org.testcontainers.containers.JdbcDatabaseContainer<SELF extends OracleFreeContainer<SELF>>
    • withOracleSecrets

      public SELF withOracleSecrets(OracleContainerSecrets secrets)
      Supplies the image credentials as files beneath /run/secrets.

      This is Docker-API portable equivalent of the documented Podman secret names. The password is not added to the container environment. Keep the supplied handle open until all containers using it have started.

      Parameters:
      secrets - shared secret material
      Returns:
      this container
    • withArchiveLog

      public SELF withArchiveLog(boolean enabled)
      Enables or disables archive logging.
    • withForceLogging

      public SELF withForceLogging(boolean enabled)
      Enables or disables force logging.
    • getOraclePort

      public Integer getOraclePort()
      Returns the mapped Oracle listener port.
    • getLivenessCheckPortNumbers

      public Set<Integer> getLivenessCheckPortNumbers()
      Specified by:
      getLivenessCheckPortNumbers in interface org.testcontainers.containers.wait.strategy.WaitStrategyTarget
      Overrides:
      getLivenessCheckPortNumbers in class org.testcontainers.containers.GenericContainer<SELF extends OracleFreeContainer<SELF>>
    • getDriverClassName

      public String getDriverClassName()
      Specified by:
      getDriverClassName in class org.testcontainers.containers.JdbcDatabaseContainer<SELF extends OracleFreeContainer<SELF>>
    • getPassword

      public String getPassword()
      Specified by:
      getPassword in class org.testcontainers.containers.JdbcDatabaseContainer<SELF extends OracleFreeContainer<SELF>>
    • waitUntilContainerStarted

      protected void waitUntilContainerStarted()
      Overrides:
      waitUntilContainerStarted in class org.testcontainers.containers.JdbcDatabaseContainer<SELF extends OracleFreeContainer<SELF>>
    • configure

      protected void configure()
      Overrides:
      configure in class org.testcontainers.containers.GenericContainer<SELF extends OracleFreeContainer<SELF>>
    • requireNotBlank

      protected static void requireNotBlank(String value, String name)
    • hasOracleSecrets

      protected final boolean hasOracleSecrets()
    • requireValidPassword

      protected static void requireValidPassword(String password)
    • requireValidPassword

      protected static void requireValidPassword(String password, String name)
    • normalizeOracleIdentifier

      protected static String normalizeOracleIdentifier(String value, String name)
    • isValidOracleIdentifier

      protected static boolean isValidOracleIdentifier(String value)
    • getTestQueryString

      protected String getTestQueryString()
      Specified by:
      getTestQueryString in class org.testcontainers.containers.JdbcDatabaseContainer<SELF extends OracleFreeContainer<SELF>>