Class GenericContainer<SELF extends GenericContainer<SELF>>
java.lang.Object
org.aksw.shellgebra.docker.adapter.cli.GenericContainer<SELF>
- All Implemented Interfaces:
org.testcontainers.containers.Container<SELF>, org.testcontainers.containers.ContainerState, org.testcontainers.containers.traits.LinkableContainer
public class GenericContainer<SELF extends GenericContainer<SELF>>
extends Object
implements org.testcontainers.containers.Container<SELF>
An implementation of the test containers API that
builds a command line that invokes the docker command.
Avoids some code duplication by relying on test container's CreateContainerCmd.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.testcontainers.containers.Container
org.testcontainers.containers.Container.ExecResult -
Field Summary
Fields inherited from interface org.testcontainers.containers.ContainerState
STATE_HEALTHY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddExposedPort(Integer port) voidaddExposedPorts(int... ports) voidaddFileSystemBind(String hostPath, String containerPath, org.testcontainers.containers.BindMode mode, org.testcontainers.containers.SelinuxContext selinuxContext) voidString[]List<com.github.dockerjava.api.model.Bind> getBinds()String[]com.github.dockerjava.api.command.InspectContainerResponsegetEnv()getImage()voidvoidsetCommand(@NonNull String command) voidsetCommand(@NonNull String... commandParts) voidsetCommandParts(String[] commandParts) voidsetDockerImageName(@NonNull String dockerImageName) voidvoidsetExposedPorts(List<Integer> exposedPorts) voidsetExtraHosts(List<String> extraHosts) voidvoidsetLinkedContainers(Map<String, org.testcontainers.containers.traits.LinkableContainer> linkedContainers) voidsetPortBindings(List<String> portBindings) voidsetWaitStrategy(org.testcontainers.containers.wait.strategy.WaitStrategy waitStrategy) waitingFor(@NonNull org.testcontainers.containers.wait.strategy.WaitStrategy waitStrategy) withClasspathResourceMapping(String resourcePath, String containerPath, org.testcontainers.containers.BindMode mode, org.testcontainers.containers.SelinuxContext selinuxContext) withCommand(String cmd) withCommand(String... commandParts) withCopyFileToContainer(org.testcontainers.utility.MountableFile mountableFile, String containerPath) withCopyToContainer(org.testcontainers.images.builder.Transferable transferable, String containerPath) withCreateContainerCmdModifier(Consumer<com.github.dockerjava.api.command.CreateContainerCmd> modifier) withExposedPorts(Integer... ports) withExtraHost(String hostname, String ipAddress) withFileSystemBind(String hostPath, String containerPath, org.testcontainers.containers.BindMode mode) withImagePullPolicy(org.testcontainers.images.ImagePullPolicy policy) withLabels(Map<String, String> labels) withLogConsumer(Consumer<org.testcontainers.containers.output.OutputFrame> consumer) withMinimumRunningDuration(Duration minimumRunningDuration) withNetwork(org.testcontainers.containers.Network network) withNetworkAliases(String... aliases) withNetworkMode(String networkMode) withPrivilegedMode(boolean mode) withStartupCheckStrategy(org.testcontainers.containers.startupcheck.StartupCheckStrategy strategy) withStartupTimeout(Duration startupTimeout) withVolumesFrom(org.testcontainers.containers.Container container, org.testcontainers.containers.BindMode mode) withWorkingDirectory(String workDir) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.testcontainers.containers.Container
addFileSystemBind, followOutput, followOutput, self, withClasspathResourceMapping, withEnv, withFileSystemBindMethods inherited from interface org.testcontainers.containers.ContainerState
copyFileFromContainer, copyFileFromContainer, copyFileToContainer, copyFileToContainer, execInContainer, execInContainer, execInContainer, execInContainer, execInContainerWithUser, execInContainerWithUser, getBoundPortNumbers, getContainerId, getContainerIpAddress, getCurrentContainerInfo, getDockerClient, getFirstMappedPort, getHost, getLogs, getLogs, getMappedPort, isCreated, isHealthy, isRunning
-
Constructor Details
-
GenericContainer
-
-
Method Details
-
buildCmdLine
-
withCreateContainerCmdModifier
-
getContainerName
- Specified by:
getContainerNamein interfaceorg.testcontainers.containers.traits.LinkableContainer
-
getExposedPorts
-
getContainerInfo
public com.github.dockerjava.api.command.InspectContainerResponse getContainerInfo()- Specified by:
getContainerInfoin interfaceorg.testcontainers.containers.ContainerState
-
setCommand
- Specified by:
setCommandin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
setCommand
- Specified by:
setCommandin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
addEnv
- Specified by:
addEnvin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
addLink
public void addLink(org.testcontainers.containers.traits.LinkableContainer otherContainer, String alias) - Specified by:
addLinkin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
addExposedPort
- Specified by:
addExposedPortin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
addExposedPorts
public void addExposedPorts(int... ports) - Specified by:
addExposedPortsin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
waitingFor
public SELF waitingFor(@NonNull org.testcontainers.containers.wait.strategy.WaitStrategy waitStrategy) - Specified by:
waitingForin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
withFileSystemBind
-
addFileSystemBind
public void addFileSystemBind(String hostPath, String containerPath, org.testcontainers.containers.BindMode mode, org.testcontainers.containers.SelinuxContext selinuxContext) - Specified by:
addFileSystemBindin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
withVolumesFrom
public SELF withVolumesFrom(org.testcontainers.containers.Container container, org.testcontainers.containers.BindMode mode) - Specified by:
withVolumesFromin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
withExposedPorts
- Specified by:
withExposedPortsin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
withCopyFileToContainer
public SELF withCopyFileToContainer(org.testcontainers.utility.MountableFile mountableFile, String containerPath) - Specified by:
withCopyFileToContainerin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
withCopyToContainer
public SELF withCopyToContainer(org.testcontainers.images.builder.Transferable transferable, String containerPath) - Specified by:
withCopyToContainerin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
withEnv
-
withEnv
-
withLabel
-
withLabels
-
withCommand
- Specified by:
withCommandin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
withCommand
- Specified by:
withCommandin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
withExtraHost
-
withNetworkMode
- Specified by:
withNetworkModein interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
withNetwork
- Specified by:
withNetworkin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
withNetworkAliases
- Specified by:
withNetworkAliasesin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
withImagePullPolicy
- Specified by:
withImagePullPolicyin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
withClasspathResourceMapping
public SELF withClasspathResourceMapping(String resourcePath, String containerPath, org.testcontainers.containers.BindMode mode, org.testcontainers.containers.SelinuxContext selinuxContext) - Specified by:
withClasspathResourceMappingin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
withStartupTimeout
- Specified by:
withStartupTimeoutin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
withPrivilegedMode
- Specified by:
withPrivilegedModein interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
withMinimumRunningDuration
- Specified by:
withMinimumRunningDurationin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
withStartupCheckStrategy
public SELF withStartupCheckStrategy(org.testcontainers.containers.startupcheck.StartupCheckStrategy strategy) - Specified by:
withStartupCheckStrategyin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
withWorkingDirectory
- Specified by:
withWorkingDirectoryin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
setDockerImageName
- Specified by:
setDockerImageNamein interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
getDockerImageName
- Specified by:
getDockerImageNamein interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
getTestHostIpAddress
- Specified by:
getTestHostIpAddressin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
withLogConsumer
- Specified by:
withLogConsumerin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
getPortBindings
- Specified by:
getPortBindingsin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>- Specified by:
getPortBindingsin interfaceorg.testcontainers.containers.ContainerState
-
getExtraHosts
- Specified by:
getExtraHostsin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
getImage
- Specified by:
getImagein interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
getEnv
- Specified by:
getEnvin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
getEnvMap
-
getCommandParts
- Specified by:
getCommandPartsin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
getBinds
- Specified by:
getBindsin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
getLinkedContainers
- Specified by:
getLinkedContainersin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
setExposedPorts
- Specified by:
setExposedPortsin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
setPortBindings
- Specified by:
setPortBindingsin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
setExtraHosts
- Specified by:
setExtraHostsin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
setImage
- Specified by:
setImagein interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
setEnv
- Specified by:
setEnvin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
setCommandParts
- Specified by:
setCommandPartsin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
setBinds
- Specified by:
setBindsin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
setLinkedContainers
public void setLinkedContainers(Map<String, org.testcontainers.containers.traits.LinkableContainer> linkedContainers) - Specified by:
setLinkedContainersin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-
setWaitStrategy
public void setWaitStrategy(org.testcontainers.containers.wait.strategy.WaitStrategy waitStrategy) - Specified by:
setWaitStrategyin interfaceorg.testcontainers.containers.Container<SELF extends GenericContainer<SELF>>
-