Search in sources :

Example 1 with StartContainer

use of org.jboss.arquillian.container.spi.event.StartContainer in project keycloak by keycloak.

the class KeycloakContainerFeaturesController method restartAuthServer.

public void restartAuthServer() throws Exception {
    if (isAuthServerRemote()) {
        try (OnlineManagementClient client = getManagementClient()) {
            int timeoutInSec = Integer.getInteger(System.getProperty("auth.server.jboss.startup.timeout"), 300);
            Administration administration = new Administration(client, timeoutInSec);
            administration.reload();
        }
    } else {
        stopContainerEvent.fire(new StopContainer(suiteContextInstance.get().getAuthServerInfo().getArquillianContainer()));
        startContainerEvent.fire(new StartContainer(suiteContextInstance.get().getAuthServerInfo().getArquillianContainer()));
    }
}
Also used : Administration(org.wildfly.extras.creaper.core.online.operations.admin.Administration) OnlineManagementClient(org.wildfly.extras.creaper.core.online.OnlineManagementClient) StartContainer(org.jboss.arquillian.container.spi.event.StartContainer) StopContainer(org.jboss.arquillian.container.spi.event.StopContainer)

Example 2 with StartContainer

use of org.jboss.arquillian.container.spi.event.StartContainer in project keycloak by keycloak.

the class AuthServerTestEnricher method restartAuthServer.

public void restartAuthServer() throws Exception {
    if (isAuthServerRemote()) {
        try (OnlineManagementClient client = getManagementClient()) {
            int timeoutInSec = Integer.getInteger(System.getProperty("auth.server.jboss.startup.timeout"), 300);
            Administration administration = new Administration(client, timeoutInSec);
            administration.reload();
        }
    } else {
        stopContainerEvent.fire(new StopContainer(suiteContext.getAuthServerInfo().getArquillianContainer()));
        startContainerEvent.fire(new StartContainer(suiteContext.getAuthServerInfo().getArquillianContainer()));
    }
}
Also used : Administration(org.wildfly.extras.creaper.core.online.operations.admin.Administration) OnlineManagementClient(org.wildfly.extras.creaper.core.online.OnlineManagementClient) StartContainer(org.jboss.arquillian.container.spi.event.StartContainer) StopContainer(org.jboss.arquillian.container.spi.event.StopContainer)

Example 3 with StartContainer

use of org.jboss.arquillian.container.spi.event.StartContainer in project keycloak by keycloak.

the class HotRodStoreTestEnricher method beforeContainerStarted.

public void beforeContainerStarted(@Observes(precedence = 1) StartSuiteContainers event) {
    if (!AuthServerTestEnricher.HOT_ROD_STORE_ENABLED)
        return;
    ContainerInfo hotRodContainer = suiteContext.getHotRodStoreInfo();
    if (hotRodContainer != null && !hotRodContainer.isStarted()) {
        log.infof("HotRod store starting: %s", hotRodContainer.getQualifier());
        startContainerEvent.fire(new StartContainer(hotRodContainer.getArquillianContainer()));
    }
}
Also used : StartContainer(org.jboss.arquillian.container.spi.event.StartContainer)

Example 4 with StartContainer

use of org.jboss.arquillian.container.spi.event.StartContainer in project keycloak by keycloak.

the class AuthServerTestEnricher method startMigratedContainer.

public void startMigratedContainer(@Observes(precedence = 3) StartSuiteContainers event) {
    if (suiteContext.isAuthServerMigrationEnabled()) {
        log.info("\n\n### Starting keycloak " + System.getProperty("migrated.auth.server.version", "- previous") + " ###\n\n");
        startContainerEvent.fire(new StartContainer(suiteContext.getMigratedAuthServerInfo().getArquillianContainer()));
        initializeTLS(suiteContext.getMigratedAuthServerInfo());
    }
}
Also used : StartContainer(org.jboss.arquillian.container.spi.event.StartContainer)

Aggregations

StartContainer (org.jboss.arquillian.container.spi.event.StartContainer)4 StopContainer (org.jboss.arquillian.container.spi.event.StopContainer)2 OnlineManagementClient (org.wildfly.extras.creaper.core.online.OnlineManagementClient)2 Administration (org.wildfly.extras.creaper.core.online.operations.admin.Administration)2