Package org.testcontainers.containers
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.
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
FieldsModifier and TypeFieldDescriptionstatic final IntegerDeprecated.static final StringDeprecated.Fields inherited from class org.testcontainers.containers.GenericContainer
CONTAINER_RUNNING_TIMEOUT_SEC, dependencies, dockerClient, INTERNAL_HOST_HOSTNAME, waitStrategyFields inherited from interface org.testcontainers.containers.ContainerState
STATE_HEALTHY -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.useCassandraContainer(DockerImageName)insteadCassandraContainer(String dockerImageName) Deprecated.CassandraContainer(org.testcontainers.utility.DockerImageName dockerImageName) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidDeprecated.protected voidcontainerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerInfo) Deprecated.com.datastax.driver.core.ClusterDeprecated.For Cassandra driver 3.x, useContainerState.getHost()andContainerState.getMappedPort(int)with the driver'sCluster.BuilderaddContactPoint(String)andwithPort(int)methods to create a Cluster object.static com.datastax.driver.core.ClustergetCluster(org.testcontainers.containers.ContainerState containerState) Deprecated.static com.datastax.driver.core.ClustergetCluster(org.testcontainers.containers.ContainerState containerState, boolean enableJmxReporting) Deprecated.Deprecated.Retrieve anInetSocketAddressfor 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 modifiedDeprecated.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 modifiedprotected voidoptionallyMapResourceParameterAsVolume(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 classwithConfigurationOverride(String configLocation) Deprecated.Initialize Cassandra with the custom overridden Cassandra configurationwithInitScript(String initScriptPath) Deprecated.Initialize Cassandra with init CQL scriptwithJmxReporting(boolean enableJmxReporting) Deprecated.Initialize Cassandra client with JMX reporting enabled or disabledMethods 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, withWorkingDirectoryMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.testcontainers.containers.Container
addFileSystemBind, followOutput, followOutput, self, withEnv, withFileSystemBindMethods 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, isRunningMethods inherited from interface org.testcontainers.lifecycle.Startable
close
-
Field Details
-
IMAGE
Deprecated. -
CQL_PORT
Deprecated.
-
-
Constructor Details
-
CassandraContainer
Deprecated.useCassandraContainer(DockerImageName)instead -
CassandraContainer
Deprecated. -
CassandraContainer
public CassandraContainer(org.testcontainers.utility.DockerImageName dockerImageName) Deprecated.
-
-
Method Details
-
configure
protected void configure()Deprecated.- Overrides:
configurein classorg.testcontainers.containers.GenericContainer<SELF extends CassandraContainer<SELF>>
-
containerIsStarted
protected void containerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerInfo) Deprecated.- Overrides:
containerIsStartedin classorg.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 dockerresourceLocation- relative classpath to resource
-
withConfigurationOverride
Deprecated.Initialize Cassandra with the custom overridden Cassandra configurationBe 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
Deprecated.Initialize Cassandra with init CQL scriptCQL script will be applied after container is started (see using WaitStrategy)
- Parameters:
initScriptPath- relative classpath resource
-
withJmxReporting
Deprecated.Initialize Cassandra client with JMX reporting enabled or disabled -
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
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.For Cassandra driver 3.x, useContainerState.getHost()andContainerState.getMappedPort(int)with the driver'sCluster.BuilderaddContactPoint(String)andwithPort(int)methods to create a Cluster object. For Cassandra driver 4.x, usegetContactPoint()andgetLocalDatacenter()with the driver'sCqlSession.builder()addContactPoint(InetSocketAddress)andwithLocalDatacenter(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
Deprecated.Retrieve anInetSocketAddressfor connecting to the Cassandra container via the driver.- Returns:
- A InetSocketAddress representation of this Cassandra container's host and port.
-
getLocalDatacenter
Deprecated.Retrieve the Local Datacenter for connecting to the Cassandra container via the driver.- Returns:
- The configured local Datacenter name.
-
CassandraContainerinstead.