Class TrueCacheContainer

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

public class TrueCacheContainer extends OracleFreeContainer<TrueCacheContainer>
Testcontainers implementation for an Oracle AI Database Free True Cache instance.

Start the primary Oracle AI Database Free container first. Both containers must be attached to the same Testcontainers Network; use aliases in the primary connection string rather than fixed container IP addresses.

  • 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 primary database service.
    static final String
    Default tag for the Oracle AI Database Free image with True Cache support.
    static final String
    Path of the primary password file inside the True Cache container.
    static final String
    Source path of the password file in the running primary database container.

    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
    Constructor
    Description
    Creates a True Cache container from the official Oracle AI Database Free image.
    TrueCacheContainer(String dockerImageName)
    Creates a True Cache container from a compatible Oracle AI Database Free image.
    TrueCacheContainer(org.testcontainers.utility.DockerImageName dockerImageName)
    Creates a True Cache container from a parsed compatible image name.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
     
     
     
    withPdbService(String pdbName, String primaryService, String trueCacheService)
    Adds a primary-PDB-service to True-Cache-service mapping.
    withPrimaryDatabase(String host, int port, String serviceName)
    Configures the primary database connection using a network alias or DNS name.
    Configures an already formatted primary database connection descriptor.
    Copies the password file extracted from the running primary container before this container starts.
    withTrueDatabaseUniqueName(String databaseUniqueName)
    Sets the unique name assigned to the True Cache database.
    withUrlParam(String paramName, String paramValue)
     
    withUsername(String username)
     

    Methods inherited from class org.testcontainers.containers.JdbcDatabaseContainer

    addParameter, constructUrlForConnection, constructUrlParameters, constructUrlParameters, containerIsStarted, createConnection, createConnection, getConnectTimeoutSeconds, getDatabaseDelegate, getJdbcDriverInstance, getStartupTimeoutSeconds, optionallyMapResourceParameterAsVolume, optionallyMapResourceParameterAsVolume, runInitScriptIfRequired, setParameters, withConnectTimeoutSeconds, withDatabaseName, withInitScript, withInitScripts, withInitScripts, withStartupTimeoutSeconds

    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

    • DEFAULT_TAG

      public static final String DEFAULT_TAG
      Default tag for the Oracle AI Database Free image with True Cache support.
      See Also:
    • DEFAULT_PRIMARY_SERVICE

      public static final String DEFAULT_PRIMARY_SERVICE
      Default primary database service.
      See Also:
    • PRIMARY_PASSWORD_FILE

      public static final String PRIMARY_PASSWORD_FILE
      Path of the primary password file inside the True Cache container.
      See Also:
    • PRIMARY_SOURCE_PASSWORD_FILE

      public static final String PRIMARY_SOURCE_PASSWORD_FILE
      Source path of the password file in the running primary database container.
      See Also:
  • Constructor Details

    • TrueCacheContainer

      public TrueCacheContainer()
      Creates a True Cache container from the official Oracle AI Database Free image.
    • TrueCacheContainer

      public TrueCacheContainer(String dockerImageName)
      Creates a True Cache container from a compatible Oracle AI Database Free image.
    • TrueCacheContainer

      public TrueCacheContainer(org.testcontainers.utility.DockerImageName dockerImageName)
      Creates a True Cache container from a parsed compatible image name.
  • Method Details

    • withPrimaryDatabase

      public TrueCacheContainer withPrimaryDatabase(String host, int port, String serviceName)
      Configures the primary database connection using a network alias or DNS name.
    • withPrimaryDatabaseConnection

      public TrueCacheContainer withPrimaryDatabaseConnection(String connection)
      Configures an already formatted primary database connection descriptor.
    • withTrueDatabaseUniqueName

      public TrueCacheContainer withTrueDatabaseUniqueName(String databaseUniqueName)
      Sets the unique name assigned to the True Cache database.
    • withPrimaryDatabasePasswordFile

      public TrueCacheContainer withPrimaryDatabasePasswordFile(Path passwordFile)
      Copies the password file extracted from the running primary container before this container starts. The caller retains ownership of the local source file.
    • withPdbService

      public TrueCacheContainer withPdbService(String pdbName, String primaryService, String trueCacheService)
      Adds a primary-PDB-service to True-Cache-service mapping.
    • withUsername

      public TrueCacheContainer withUsername(String username)
      Overrides:
      withUsername in class org.testcontainers.containers.JdbcDatabaseContainer<TrueCacheContainer>
    • getJdbcUrl

      public String getJdbcUrl()
      Specified by:
      getJdbcUrl in class org.testcontainers.containers.JdbcDatabaseContainer<TrueCacheContainer>
    • getUsername

      public String getUsername()
      Specified by:
      getUsername in class org.testcontainers.containers.JdbcDatabaseContainer<TrueCacheContainer>
    • getDatabaseName

      public String getDatabaseName()
      Overrides:
      getDatabaseName in class org.testcontainers.containers.JdbcDatabaseContainer<TrueCacheContainer>
    • configure

      protected void configure()
      Overrides:
      configure in class OracleFreeContainer<TrueCacheContainer>
    • withUrlParam

      public TrueCacheContainer withUrlParam(String paramName, String paramValue)
      Overrides:
      withUrlParam in class org.testcontainers.containers.JdbcDatabaseContainer<TrueCacheContainer>