Package org.testcontainers.containers
Class YugabyteDBYCQLContainer
java.lang.Object
org.testcontainers.containers.GenericContainer<YugabyteDBYCQLContainer>
org.testcontainers.containers.YugabyteDBYCQLContainer
- All Implemented Interfaces:
AutoCloseable,org.testcontainers.containers.Container<YugabyteDBYCQLContainer>,org.testcontainers.containers.ContainerState,org.testcontainers.containers.traits.LinkableContainer,org.testcontainers.containers.wait.strategy.WaitStrategyTarget,org.testcontainers.lifecycle.Startable
public class YugabyteDBYCQLContainer
extends org.testcontainers.containers.GenericContainer<YugabyteDBYCQLContainer>
Testcontainers implementation for YugabyteDB YCQL API.
Supported image: yugabytedb/yugabyte
Exposed ports:
- YCQL: 5433
- Master dashboard: 7000
- Tserver dashboard: 9000
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.testcontainers.containers.Container
org.testcontainers.containers.Container.ExecResult -
Field Summary
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
ConstructorsConstructorDescriptionYugabyteDBYCQLContainer(String imageName) YugabyteDBYCQLContainer(org.testcontainers.utility.DockerImageName imageName) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidConfigures the environment variables.protected voidcontainerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerInfo) Executes the initialization scriptReturns aInetSocketAddressrepresentation of YCQL's contact point infoKeyspace getter methodReturns the local datacenter namePassword getter methodUsername getter methodwithInitScript(String initScript) withKeyspaceName(String keyspace) Setting this would create the keyspacewithPassword(String password) Setting this along withwithUsername(String)would enable authenticationwithUsername(String username) Setting this would create the custom user roleMethods 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, 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
-
Constructor Details
-
YugabyteDBYCQLContainer
- Parameters:
imageName- image name
-
YugabyteDBYCQLContainer
public YugabyteDBYCQLContainer(org.testcontainers.utility.DockerImageName imageName) - Parameters:
imageName- image name
-
-
Method Details
-
getLivenessCheckPortNumbers
- Specified by:
getLivenessCheckPortNumbersin interfaceorg.testcontainers.containers.wait.strategy.WaitStrategyTarget- Overrides:
getLivenessCheckPortNumbersin classorg.testcontainers.containers.GenericContainer<YugabyteDBYCQLContainer>
-
configure
protected void configure()Configures the environment variables. Setting up these variables would create the custom objects. SettingwithKeyspaceName(String),withUsername(String),withPassword(String)these parameters will initialize the database with those custom values- Overrides:
configurein classorg.testcontainers.containers.GenericContainer<YugabyteDBYCQLContainer>
-
withInitScript
- Parameters:
initScript- path of the initialization script file- Returns:
YugabyteDBYCQLContainerinstance
-
withKeyspaceName
Setting this would create the keyspace- Parameters:
keyspace- keyspace- Returns:
YugabyteDBYCQLContainerinstance
-
withUsername
Setting this would create the custom user role- Parameters:
username- user name- Returns:
YugabyteDBYCQLContainerinstance
-
withPassword
Setting this along withwithUsername(String)would enable authentication- Parameters:
password- password- Returns:
YugabyteDBYCQLContainerinstance
-
containerIsStarted
protected void containerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerInfo) Executes the initialization script- Overrides:
containerIsStartedin classorg.testcontainers.containers.GenericContainer<YugabyteDBYCQLContainer>- Parameters:
containerInfo- containerInfo
-
getContactPoint
Returns aInetSocketAddressrepresentation of YCQL's contact point info- Returns:
- contactpoint
-
getLocalDc
Returns the local datacenter name- Returns:
- localdc name
-
getUsername
Username getter method- Returns:
- username
-
getPassword
Password getter method- Returns:
- password
-
getKeyspace
Keyspace getter method- Returns:
- keyspace
-