Class OperatonMSSQLContainer<SELF extends org.testcontainers.containers.MSSQLServerContainer<SELF>>

java.lang.Object
org.testcontainers.containers.FailureDetectingExternalResource
org.testcontainers.containers.GenericContainer<SELF>
org.testcontainers.containers.JdbcDatabaseContainer<SELF>
org.testcontainers.containers.MSSQLServerContainer<SELF>
org.operaton.impl.test.utils.testcontainers.OperatonMSSQLContainer<SELF>
All Implemented Interfaces:
AutoCloseable, org.junit.rules.TestRule, org.testcontainers.containers.Container<SELF>, org.testcontainers.containers.ContainerState, org.testcontainers.containers.traits.LinkableContainer, org.testcontainers.containers.wait.strategy.WaitStrategyTarget, org.testcontainers.lifecycle.Startable

public class OperatonMSSQLContainer<SELF extends org.testcontainers.containers.MSSQLServerContainer<SELF>> extends org.testcontainers.containers.MSSQLServerContainer<SELF>
Class for setting up a MSSQLServer database and managing its lifecycle within the test environment. This class is a custom extension of Testcontainers' MSSQLServerContainer , providing additional functionality for the Operaton project.
  • 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 inherited from class org.testcontainers.containers.MSSQLServerContainer

    DEFAULT_TAG, IMAGE, MS_SQL_SERVER_PORT, NAME

    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
    OperatonMSSQLContainer(String dockerImageName)
     
    OperatonMSSQLContainer(org.testcontainers.utility.DockerImageName dockerImageName)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    containerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerResponse)
    Hook to set up a database with correct transaction isolation after starting the container and setting it as a default.

    Methods inherited from class org.testcontainers.containers.MSSQLServerContainer

    acceptLicense, configure, constructUrlForConnection, getDriverClassName, getJdbcUrl, getLivenessCheckPortNumbers, getPassword, getTestQueryString, getUsername, withPassword

    Methods inherited from class org.testcontainers.containers.JdbcDatabaseContainer

    addParameter, constructUrlParameters, constructUrlParameters, createConnection, createConnection, getConnectTimeoutSeconds, getDatabaseDelegate, getDatabaseName, getJdbcDriverInstance, getStartupTimeoutSeconds, optionallyMapResourceParameterAsVolume, optionallyMapResourceParameterAsVolume, runInitScriptIfRequired, setParameters, waitUntilContainerStarted, withConnectTimeoutSeconds, withDatabaseName, withInitScript, withInitScripts, withInitScripts, withStartupTimeoutSeconds, withUrlParam, withUsername

    Methods inherited from class org.testcontainers.containers.GenericContainer

    addEnv, addExposedPort, addExposedPorts, addFileSystemBind, addFixedExposedPort, addFixedExposedPort, addLink, apply, canBeReused, containerIsCreated, containerIsStarted, containerIsStarting, containerIsStarting, containerIsStopped, containerIsStopping, copyFileFromContainer, createVolumeDirectory, dependsOn, dependsOn, dependsOn, doStart, equals, failed, finished, 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, starting, stop, succeeded, 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 java.lang.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
  • Constructor Details

    • OperatonMSSQLContainer

      public OperatonMSSQLContainer(org.testcontainers.utility.DockerImageName dockerImageName)
    • OperatonMSSQLContainer

      public OperatonMSSQLContainer(String dockerImageName)
  • Method Details

    • containerIsStarted

      protected void containerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerResponse)
      Hook to set up a database with correct transaction isolation after starting the container and setting it as a default. Necessary, because the master DB of SQL server has some constraints and cannot be configured to enable READ_COMMITTED_SNAPSHOT. Cannot be put into `OperatonMSSQLContainerProvider`, as this has no influence over the container after it was started
      Overrides:
      containerIsStarted in class org.testcontainers.containers.JdbcDatabaseContainer<SELF extends org.testcontainers.containers.MSSQLServerContainer<SELF>>
      Parameters:
      containerResponse - Metadata of the started container