Search in sources :

Example 16 with TestFrameworkException

use of io.pravega.test.system.framework.TestFrameworkException in project pravega by pravega.

the class DockerBasedService method getServiceID.

private String getServiceID() {
    Service.Criteria criteria = Service.Criteria.builder().serviceName(this.serviceName).build();
    String serviceId = null;
    try {
        List<Service> serviceList = Exceptions.handleInterruptedCall(() -> dockerClient.listServices(criteria));
        log.info("Service list size {}", serviceList.size());
        if (!serviceList.isEmpty()) {
            serviceId = serviceList.get(0).id();
        }
    } catch (DockerException e) {
        throw new TestFrameworkException(TestFrameworkException.Type.RequestFailed, "Unable to get service id", e);
    }
    return serviceId;
}
Also used : DockerException(com.spotify.docker.client.exceptions.DockerException) TestFrameworkException(io.pravega.test.system.framework.TestFrameworkException) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) Service(com.spotify.docker.client.messages.swarm.Service)

Aggregations

TestFrameworkException (io.pravega.test.system.framework.TestFrameworkException)16 MarathonException (mesosphere.marathon.client.MarathonException)7 DockerException (com.spotify.docker.client.exceptions.DockerException)6 Service (com.spotify.docker.client.messages.swarm.Service)5 ExecutionException (java.util.concurrent.ExecutionException)5 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)5 TimeoutException (java.util.concurrent.TimeoutException)4 IOException (java.io.IOException)2 ServiceCreateResponse (com.spotify.docker.client.messages.ServiceCreateResponse)1 EndpointSpec (com.spotify.docker.client.messages.swarm.EndpointSpec)1 TaskSpec (com.spotify.docker.client.messages.swarm.TaskSpec)1 ApiClient (io.kubernetes.client.openapi.ApiClient)1 ApiException (io.kubernetes.client.openapi.ApiException)1 InputStream (java.io.InputStream)1 Method (java.lang.reflect.Method)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 Cleanup (lombok.Cleanup)1 App (mesosphere.marathon.client.model.v2.App)1 GetAppResponse (mesosphere.marathon.client.model.v2.GetAppResponse)1 Result (mesosphere.marathon.client.model.v2.Result)1