Skip to content

Commit

Permalink
Removing throws Exception. Fixes jboss-eap-qe#194
Browse files Browse the repository at this point in the history
  • Loading branch information
honza-kasik committed Jan 23, 2020
1 parent 23d985b commit 7ac5967
Show file tree
Hide file tree
Showing 11 changed files with 376 additions and 129 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package org.jboss.eap.qe.ts.common.docker;

/**
* Describes public interface available for a container (not an Arquillian one but the operating system level
* virtualization unit).
*/
public interface Container {

/**
* Start this container
*
* @throws ContainerStartException thrown when start of container fails
*/
void start() throws ContainerStartException;

/**
* @return Returns true if docker container is running. It does NOT check whether container is ready.
*/
boolean isRunning();

/**
* Stop this docker container using docker command.
*
* @throws ContainerStopException thrown when the stop command fails. This generally means that the command wasn't
* successful and container might be still running.
*/
void stop() throws ContainerStopException;

/**
* Kill this docker container using docker command. Be aware that there might occur a situation when the docker
* command might fail. This might be caused for example by reaching file descriptors limit in system.
*
* @throws ContainerKillException thrown when the kill command fails.
*/
void kill() throws ContainerKillException;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.jboss.eap.qe.ts.common.docker;

/**
* An exception thrown when killing a container fails
*/
public class ContainerKillException extends Exception {

public ContainerKillException() {
super();
}

public ContainerKillException(String message) {
super(message);
}

public ContainerKillException(String message, Throwable cause) {
super(message, cause);
}

public ContainerKillException(Throwable cause) {
super(cause);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
package org.jboss.eap.qe.ts.common.docker;

public class ContainerReadyConditionException extends RuntimeException {
/**
* An exception thrown when checking for container readiness fails
*/
public class ContainerReadyConditionException extends Exception {

public ContainerReadyConditionException(String message, Throwable cause) {
super(message, cause);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.jboss.eap.qe.ts.common.docker;

/**
* An exception thrown when container removal fails
*/
public class ContainerRemoveException extends Exception {

public ContainerRemoveException() {
super();
}

public ContainerRemoveException(String message) {
super(message);
}

public ContainerRemoveException(String message, Throwable cause) {
super(message, cause);
}

public ContainerRemoveException(Throwable cause) {
super(cause);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.jboss.eap.qe.ts.common.docker;

/**
* An exception thrown when container start fails
*/
public class ContainerStartException extends Exception {

public ContainerStartException() {
super();
}

public ContainerStartException(String message) {
super(message);
}

public ContainerStartException(String message, Throwable cause) {
super(message, cause);
}

public ContainerStartException(Throwable cause) {
super(cause);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.jboss.eap.qe.ts.common.docker;

/**
* An exception thrown when container stop fails
*/
public class ContainerStopException extends Exception {

public ContainerStopException() {
super();
}

public ContainerStopException(String message) {
super(message);
}

public ContainerStopException(String message, Throwable cause) {
super(message, cause);
}

public ContainerStopException(Throwable cause) {
super(cause);
}
}
Loading

0 comments on commit 7ac5967

Please sign in to comment.