Class CassandraContainer<SELF extends CassandraContainer<SELF>>

java.lang.Object
org.testcontainers.containers.GenericContainer<SELF>
org.testcontainers.containers.CassandraContainer<SELF>
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

@Deprecated public class CassandraContainer<SELF extends CassandraContainer<SELF>> extends org.testcontainers.containers.GenericContainer<SELF>
Deprecated.
use CassandraContainer instead.
Testcontainers implementation for Apache Cassandra.

Supported image: cassandra

Exposed ports: 9042

  • 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 Integer
    Deprecated.
     
    static final String
    Deprecated.

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

    Modifier and Type
    Method
    Description
    protected void
    Deprecated.
     
    protected void
    containerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerInfo)
    Deprecated.
     
    com.datastax.driver.core.Cluster
    Deprecated.
    For Cassandra driver 3.x, use ContainerState.getHost() and ContainerState.getMappedPort(int) with the driver's Cluster.Builder addContactPoint(String) and withPort(int) methods to create a Cluster object.
    static com.datastax.driver.core.Cluster
    getCluster(org.testcontainers.containers.ContainerState containerState)
    Deprecated.
    static com.datastax.driver.core.Cluster
    getCluster(org.testcontainers.containers.ContainerState containerState, boolean enableJmxReporting)
    Deprecated.
    Deprecated.
    Retrieve an InetSocketAddress for connecting to the Cassandra container via the driver.
    Deprecated.
    Retrieve the Local Datacenter for connecting to the Cassandra container via the driver.
    Deprecated.
    Get password By default Cassandra has authenticator: AllowAllAuthenticator in cassandra.yaml If username and password need to be used, then authenticator should be set as PasswordAuthenticator (through custom Cassandra configuration) and through CQL with default cassandra-cassandra credentials user management should be modified
    Deprecated.
    Get username By default Cassandra has authenticator: AllowAllAuthenticator in cassandra.yaml If username and password need to be used, then authenticator should be set as PasswordAuthenticator (through custom Cassandra configuration) and through CQL with default cassandra-cassandra credentials user management should be modified
    protected void
    optionallyMapResourceParameterAsVolume(String pathNameInContainer, String resourceLocation)
    Deprecated.
    Map (effectively replace) directory in Docker with the content of resourceLocation if resource location is not null Protected to allow for changing implementation by extending the class
    Deprecated.
    Initialize Cassandra with the custom overridden Cassandra configuration
    withInitScript(String initScriptPath)
    Deprecated.
    Initialize Cassandra with init CQL script
    withJmxReporting(boolean enableJmxReporting)
    Deprecated.
    Initialize Cassandra client with JMX reporting enabled or disabled

    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, 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, start, 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 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.lifecycle.Startable

    close
  • Field Details

    • IMAGE

      @Deprecated public static final String IMAGE
      Deprecated.
    • CQL_PORT

      public static final Integer CQL_PORT
      Deprecated.
  • Constructor Details

    • CassandraContainer

      @Deprecated public CassandraContainer()
      Deprecated.
    • CassandraContainer

      public CassandraContainer(String dockerImageName)
      Deprecated.
    • CassandraContainer

      public CassandraContainer(org.testcontainers.utility.DockerImageName dockerImageName)
      Deprecated.
  • Method Details

    • configure

      protected void configure()
      Deprecated.
      Overrides:
      configure in class org.testcontainers.containers.GenericContainer<SELF extends CassandraContainer<SELF>>
    • containerIsStarted

      protected void containerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerInfo)
      Deprecated.
      Overrides:
      containerIsStarted in class org.testcontainers.containers.GenericContainer<SELF extends CassandraContainer<SELF>>
    • optionallyMapResourceParameterAsVolume

      protected void optionallyMapResourceParameterAsVolume(String pathNameInContainer, String resourceLocation)
      Deprecated.
      Map (effectively replace) directory in Docker with the content of resourceLocation if resource location is not null Protected to allow for changing implementation by extending the class
      Parameters:
      pathNameInContainer - path in docker
      resourceLocation - relative classpath to resource
    • withConfigurationOverride

      public SELF withConfigurationOverride(String configLocation)
      Deprecated.
      Initialize Cassandra with the custom overridden Cassandra configuration

      Be aware, that Docker effectively replaces all /etc/cassandra content with the content of config location, so if Cassandra.yaml in configLocation is absent or corrupted, then Cassandra just won't launch

      Parameters:
      configLocation - relative classpath with the directory that contains cassandra.yaml and other configuration files
    • withInitScript

      public SELF withInitScript(String initScriptPath)
      Deprecated.
      Initialize Cassandra with init CQL script

      CQL script will be applied after container is started (see using WaitStrategy)

      Parameters:
      initScriptPath - relative classpath resource
    • withJmxReporting

      public SELF withJmxReporting(boolean enableJmxReporting)
      Deprecated.
      Initialize Cassandra client with JMX reporting enabled or disabled
    • getUsername

      public String getUsername()
      Deprecated.
      Get username By default Cassandra has authenticator: AllowAllAuthenticator in cassandra.yaml If username and password need to be used, then authenticator should be set as PasswordAuthenticator (through custom Cassandra configuration) and through CQL with default cassandra-cassandra credentials user management should be modified
    • getPassword

      public String getPassword()
      Deprecated.
      Get password By default Cassandra has authenticator: AllowAllAuthenticator in cassandra.yaml If username and password need to be used, then authenticator should be set as PasswordAuthenticator (through custom Cassandra configuration) and through CQL with default cassandra-cassandra credentials user management should be modified
    • getCluster

      @Deprecated public com.datastax.driver.core.Cluster getCluster()
      Deprecated.
      For Cassandra driver 3.x, use ContainerState.getHost() and ContainerState.getMappedPort(int) with the driver's Cluster.Builder addContactPoint(String) and withPort(int) methods to create a Cluster object. For Cassandra driver 4.x, use getContactPoint() and getLocalDatacenter() with the driver's CqlSession.builder() addContactPoint(InetSocketAddress) and withLocalDatacenter(String) methods to create a Session Object. See https://docs.datastax.com/en/developer/java-driver/ for more on the driver.
      Get configured Cluster Can be used to obtain connections to Cassandra in the container
    • getCluster

      @Deprecated public static com.datastax.driver.core.Cluster getCluster(org.testcontainers.containers.ContainerState containerState, boolean enableJmxReporting)
      Deprecated.
    • getCluster

      @Deprecated public static com.datastax.driver.core.Cluster getCluster(org.testcontainers.containers.ContainerState containerState)
      Deprecated.
    • getContactPoint

      public InetSocketAddress getContactPoint()
      Deprecated.
      Retrieve an InetSocketAddress for connecting to the Cassandra container via the driver.
      Returns:
      A InetSocketAddress representation of this Cassandra container's host and port.
    • getLocalDatacenter

      public String getLocalDatacenter()
      Deprecated.
      Retrieve the Local Datacenter for connecting to the Cassandra container via the driver.
      Returns:
      The configured local Datacenter name.