Package io.ebean.test.containers
Class Commands
java.lang.Object
io.ebean.test.containers.Commands
Common Docker container commands.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisRegistered(String containerName) Return true if the container is registered (exists and maybe running or not).booleanReturn true if the container is running.Return true if the logs of the container contain the match text.Return the logs for the container with a tail.booleanlogsContain(String containerName, String match) Return true if the logs of the container contain the match text.booleanlogsContain(String containerName, String logMessage, int tail) Return true if the container logs contains the logMessage.booleanlogsContain(String containerName, String match, String clearMatch) logsWithMatch(String containerName, String match, String clearMatch) Return true if the logs of the container contain the match text.intReturn the first mapped port for the given container.Return the ports output as lines.registeredPortMatch(String containerName, int matchPort) Check if the port matches the existing port bindings and if not return the existing port bindings.voidRemove the container.voidremoveContainers(String... containerNames) voidremoveIfRegistered(String containerName, boolean skipRunningCheck) Stop and remove the container.voidStart the container.voidStop the container.voidstopContainers(String... containerNames) voidstopIfRunning(String containerName, boolean skipRunningCheck) Stop the container checking to see if it is running first.
-
Constructor Details
-
Commands
public Commands()Create with 'docker' as the command. -
Commands
Construct with explicit docker command.
-
-
Method Details
-
stopIfRunning
Stop the container checking to see if it is running first. -
removeIfRegistered
Stop and remove the container. -
remove
Remove the container. -
start
Start the container. -
stop
Stop the container. -
removeContainers
-
stopContainers
-
isRunning
Return true if the container is running. -
isRegistered
Return true if the container is registered (exists and maybe running or not). -
port
Return the first mapped port for the given container. -
logsContain
Return true if the logs of the container contain the match text. -
logsContain
-
logsWithMatch
Return true if the logs of the container contain the match text. -
logs
Return true if the logs of the container contain the match text. -
ports
Return the ports output as lines. -
registeredPortMatch
Check if the port matches the existing port bindings and if not return the existing port bindings. -
logsContain
Return true if the container logs contains the logMessage.Usually used to find a log entry to indicate the container is ready for use.
- Parameters:
containerName- The container logs to searchlogMessage- The logMessage we are looking for (to usually indicate the container is ready).tail- The number of logs to tail (such that we get recent and minimal logs)- Returns:
- True if the logs searched contain the logMessage
-
logs
Return the logs for the container with a tail.If tail = 0 then all logs are returned (but we should be careful using that).
-