Package org.testcontainers.containers
Class YugabyteDBYSQLContainer
java.lang.Object
org.testcontainers.containers.GenericContainer<SELF>
org.testcontainers.containers.JdbcDatabaseContainer<YugabyteDBYSQLContainer>
org.testcontainers.containers.YugabyteDBYSQLContainer
- All Implemented Interfaces:
AutoCloseable,org.testcontainers.containers.Container<YugabyteDBYSQLContainer>,org.testcontainers.containers.ContainerState,org.testcontainers.containers.traits.LinkableContainer,org.testcontainers.containers.wait.strategy.WaitStrategyTarget,org.testcontainers.lifecycle.Startable
public class YugabyteDBYSQLContainer
extends org.testcontainers.containers.JdbcDatabaseContainer<YugabyteDBYSQLContainer>
Testcontainers implementation for YugabyteDB YSQL API.
Supported image: yugabytedb/yugabyte
Exposed ports:
- YSQL: 5433
- Master dashboard: 7000
- Tserver dashboard: 9000
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.testcontainers.containers.JdbcDatabaseContainer
org.testcontainers.containers.JdbcDatabaseContainer.NoDriverFoundExceptionNested classes/interfaces inherited from interface org.testcontainers.containers.Container
org.testcontainers.containers.Container.ExecResult -
Field Summary
Fields inherited from class org.testcontainers.containers.JdbcDatabaseContainer
parameters, urlParametersFields 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
ConstructorsConstructorDescriptionYugabyteDBYSQLContainer(String imageName) YugabyteDBYSQLContainer(org.testcontainers.utility.DockerImageName imageName) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidConfigures the environment variables.protected voidwithDatabaseName(String database) 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.JdbcDatabaseContainer
addParameter, constructUrlForConnection, constructUrlParameters, constructUrlParameters, containerIsStarted, createConnection, createConnection, getConnectTimeoutSeconds, getDatabaseDelegate, getJdbcDriverInstance, getStartupTimeoutSeconds, optionallyMapResourceParameterAsVolume, optionallyMapResourceParameterAsVolume, runInitScriptIfRequired, setParameters, withConnectTimeoutSeconds, withInitScript, withInitScripts, withInitScripts, withStartupTimeoutSeconds, withUrlParamMethods 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, 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.containers.traits.LinkableContainer
getContainerNameMethods inherited from interface org.testcontainers.lifecycle.Startable
close
-
Constructor Details
-
YugabyteDBYSQLContainer
- Parameters:
imageName- image name
-
YugabyteDBYSQLContainer
public YugabyteDBYSQLContainer(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<YugabyteDBYSQLContainer>
-
configure
protected void configure()Configures the environment variables. Setting up these variables would create the custom objects. SettingwithDatabaseName(String),withUsername(String),withPassword(String)these parameters will initialize the database with those custom values- Overrides:
configurein classorg.testcontainers.containers.GenericContainer<YugabyteDBYSQLContainer>
-
getDriverClassName
- Specified by:
getDriverClassNamein classorg.testcontainers.containers.JdbcDatabaseContainer<YugabyteDBYSQLContainer>
-
getJdbcUrl
- Specified by:
getJdbcUrlin classorg.testcontainers.containers.JdbcDatabaseContainer<YugabyteDBYSQLContainer>
-
getDatabaseName
- Overrides:
getDatabaseNamein classorg.testcontainers.containers.JdbcDatabaseContainer<YugabyteDBYSQLContainer>
-
getUsername
- Specified by:
getUsernamein classorg.testcontainers.containers.JdbcDatabaseContainer<YugabyteDBYSQLContainer>
-
getPassword
- Specified by:
getPasswordin classorg.testcontainers.containers.JdbcDatabaseContainer<YugabyteDBYSQLContainer>
-
getTestQueryString
- Specified by:
getTestQueryStringin classorg.testcontainers.containers.JdbcDatabaseContainer<YugabyteDBYSQLContainer>
-
withDatabaseName
Setting this would create the keyspace- Overrides:
withDatabaseNamein classorg.testcontainers.containers.JdbcDatabaseContainer<YugabyteDBYSQLContainer>- Parameters:
database- database name- Returns:
YugabyteDBYSQLContainerinstance
-
withUsername
Setting this would create the custom user role- Overrides:
withUsernamein classorg.testcontainers.containers.JdbcDatabaseContainer<YugabyteDBYSQLContainer>- Parameters:
username- user name- Returns:
YugabyteDBYSQLContainerinstance
-
withPassword
Setting this along withwithUsername(String)would enable authentication- Overrides:
withPasswordin classorg.testcontainers.containers.JdbcDatabaseContainer<YugabyteDBYSQLContainer>- Parameters:
password- password- Returns:
YugabyteDBYSQLContainerinstance
-
waitUntilContainerStarted
protected void waitUntilContainerStarted()- Overrides:
waitUntilContainerStartedin classorg.testcontainers.containers.JdbcDatabaseContainer<YugabyteDBYSQLContainer>
-