Search in sources :

Example 1 with Component

use of io.syndesis.qe.Component in project syndesis-qe by syndesisio.

the class CommonSteps method waitForSyndeisis.

@Then("^wait for Syndesis to become ready")
public void waitForSyndeisis() {
    EnumSet<Component> components = EnumSet.allOf(Component.class);
    ExecutorService executorService = Executors.newFixedThreadPool(10);
    components.forEach(c -> {
        Runnable runnable = () -> OpenShiftUtils.xtf().waiters().areExactlyNPodsRunning(1, "component", c.getName()).interval(TimeUnit.SECONDS, 20).timeout(TimeUnit.MINUTES, 12).assertEventually();
        executorService.submit(runnable);
    });
    executorService.shutdown();
    try {
        if (!executorService.awaitTermination(10, TimeUnit.MINUTES)) {
            executorService.shutdownNow();
            Assertions.fail("Syndesis wasn't initilized in time");
        }
    } catch (InterruptedException e) {
        Assertions.fail("Syndesis wasn't initilized in time");
    }
}
Also used : ExecutorService(java.util.concurrent.ExecutorService) Component(io.syndesis.qe.Component) Then(cucumber.api.java.en.Then)

Aggregations

Then (cucumber.api.java.en.Then)1 Component (io.syndesis.qe.Component)1 ExecutorService (java.util.concurrent.ExecutorService)1