Search in sources :

Example 6 with OpenShiftHelper

use of io.vertx.it.openshift.utils.OpenShiftHelper in project vertx-openshift-it by cescoffier.

the class CountersIT method initialize.

@BeforeClass
public static void initialize() throws IOException {
    initializeServiceAccount();
    SortedMap<String, File> dependencies = new TreeMap<>();
    dependencies.put("A-Counters", new File("../" + APPLICATION_NAME + "/target/classes/META-INF/fabric8/openshift.yml"));
    dependencies.forEach((name, template) -> Ensure.ensureThat(String.format("template file %s can be deployed", template), () -> deploymentAssistant.deploy(name, template)));
    Ensure.ensureThat("The counters app is up and running", () -> await().atMost(5, TimeUnit.MINUTES).catchUncaughtExceptions().untilAsserted(() -> {
        Service service = client.services().withName(APPLICATION_NAME).get();
        Assertions.assertThat(service).isNotNull();
        route = client.routes().withName(APPLICATION_NAME).get();
        Assertions.assertThat(route).isNotNull();
        get(Kube.urlForRoute(route, "/health")).then().statusCode(200);
    }));
    clusterCountersHelper = new OpenShiftHelper(client, APPLICATION_NAME);
}
Also used : Service(io.fabric8.kubernetes.api.model.Service) TreeMap(java.util.TreeMap) File(java.io.File) OpenShiftHelper(io.vertx.it.openshift.utils.OpenShiftHelper) BeforeClass(org.junit.BeforeClass)

Example 7 with OpenShiftHelper

use of io.vertx.it.openshift.utils.OpenShiftHelper in project vertx-openshift-it by cescoffier.

the class EventBusIT method initialize.

@BeforeClass
public static void initialize() throws IOException {
    initializeServiceAccount();
    SortedMap<String, File> dependencies = new TreeMap<>();
    dependencies.put("A-EventBus", new File("../" + APPLICATION_NAME + "/target/classes/META-INF/fabric8/openshift.yml"));
    dependencies.forEach((name, template) -> Ensure.ensureThat(String.format("template file %s can be deployed", template), () -> deploymentAssistant.deploy(name, template)));
    Ensure.ensureThat("The event-bus app is up and running", () -> await().atMost(5, TimeUnit.MINUTES).catchUncaughtExceptions().untilAsserted(() -> {
        Service service = client.services().withName(APPLICATION_NAME).get();
        Assertions.assertThat(service).isNotNull();
        route = client.routes().withName(APPLICATION_NAME).get();
        Assertions.assertThat(route).isNotNull();
        get(Kube.urlForRoute(route, "/health")).then().statusCode(200);
    }));
    clusterEventBusHelper = new OpenShiftHelper(client, APPLICATION_NAME);
}
Also used : Service(io.fabric8.kubernetes.api.model.Service) TreeMap(java.util.TreeMap) File(java.io.File) OpenShiftHelper(io.vertx.it.openshift.utils.OpenShiftHelper) BeforeClass(org.junit.BeforeClass)

Example 8 with OpenShiftHelper

use of io.vertx.it.openshift.utils.OpenShiftHelper in project vertx-openshift-it by cescoffier.

the class LocksIT method initialize.

@BeforeClass
public static void initialize() throws IOException {
    initializeServiceAccount();
    SortedMap<String, File> dependencies = new TreeMap<>();
    dependencies.put("A-Locks", new File("../" + APPLICATION_NAME + "/target/classes/META-INF/fabric8/openshift.yml"));
    dependencies.forEach((name, template) -> Ensure.ensureThat(String.format("template file %s can be deployed", template), () -> deploymentAssistant.deploy(name, template)));
    Ensure.ensureThat("The locks app is up and running", () -> await().atMost(5, TimeUnit.MINUTES).catchUncaughtExceptions().untilAsserted(() -> {
        Service service = client.services().withName(APPLICATION_NAME).get();
        Assertions.assertThat(service).isNotNull();
        route = client.routes().withName(APPLICATION_NAME).get();
        Assertions.assertThat(route).isNotNull();
        get(Kube.urlForRoute(route, "/health")).then().statusCode(200);
    }));
    clusterLocksHelper = new OpenShiftHelper(client, APPLICATION_NAME);
}
Also used : Service(io.fabric8.kubernetes.api.model.Service) TreeMap(java.util.TreeMap) File(java.io.File) OpenShiftHelper(io.vertx.it.openshift.utils.OpenShiftHelper) BeforeClass(org.junit.BeforeClass)

Example 9 with OpenShiftHelper

use of io.vertx.it.openshift.utils.OpenShiftHelper in project vertx-openshift-it by cescoffier.

the class AsyncMapRollingUpdateIT method initialize.

@BeforeClass
public static void initialize() throws IOException {
    initializeServiceAccount();
    SortedMap<String, File> dependencies = new TreeMap<>();
    dependencies.put("A-RUAsyncMap", new File("../" + APPLICATION_NAME + "/target/classes/META-INF/fabric8/openshift.yml"));
    dependencies.forEach((name, template) -> Ensure.ensureThat(String.format("template file %s can be deployed", template), () -> deploymentAssistant.deploy(name, template)));
    Ensure.ensureThat("The asyncmap app is up and running", () -> await().atMost(5, TimeUnit.MINUTES).catchUncaughtExceptions().untilAsserted(() -> {
        Service service = client.services().withName(APPLICATION_NAME).get();
        Assertions.assertThat(service).isNotNull();
        route = client.routes().withName(APPLICATION_NAME).get();
        Assertions.assertThat(route).isNotNull();
        get(Kube.urlForRoute(route, "/ready")).then().statusCode(200);
    }));
    clusterRuAsyncMapHelper = new OpenShiftHelper(client, APPLICATION_NAME);
}
Also used : Service(io.fabric8.kubernetes.api.model.Service) TreeMap(java.util.TreeMap) File(java.io.File) OpenShiftHelper(io.vertx.it.openshift.utils.OpenShiftHelper) BeforeClass(org.junit.BeforeClass)

Aggregations

OpenShiftHelper (io.vertx.it.openshift.utils.OpenShiftHelper)9 File (java.io.File)9 BeforeClass (org.junit.BeforeClass)9 TreeMap (java.util.TreeMap)8 Service (io.fabric8.kubernetes.api.model.Service)7