Search in sources :

Example 1 with Administration

use of org.wildfly.extras.creaper.core.online.operations.admin.Administration in project keycloak by keycloak.

the class AbstractBasePhotozExampleAdapterTest method fixBrokenDeserializationOnEAP6.

// workaround for KEYCLOAK-8660 from https://stackoverflow.com/questions/50917932/what-versions-of-jackson-are-allowed-in-jboss-6-4-20-patch
@Before
public void fixBrokenDeserializationOnEAP6() throws IOException, CliException, TimeoutException, InterruptedException {
    if (AppServerTestEnricher.isEAP6AppServer()) {
        OnlineManagementClient client = AppServerTestEnricher.getManagementClient();
        Administration administration = new Administration(client);
        client.execute("/system-property=jackson.deserialization.whitelist.packages:add(value=org.keycloak.example.photoz)");
        administration.reloadIfRequired();
    }
}
Also used : Administration(org.wildfly.extras.creaper.core.online.operations.admin.Administration) OnlineManagementClient(org.wildfly.extras.creaper.core.online.OnlineManagementClient) Before(org.junit.Before)

Example 2 with Administration

use of org.wildfly.extras.creaper.core.online.operations.admin.Administration 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 3 with Administration

use of org.wildfly.extras.creaper.core.online.operations.admin.Administration in project keycloak by keycloak.

the class AuthServerTestEnricher method executeCli.

public static void executeCli(String... commands) throws Exception {
    OnlineManagementClient client = AuthServerTestEnricher.getManagementClient();
    Administration administration = new Administration(client);
    for (String c : commands) {
        client.execute(c).assertSuccess();
    }
    administration.reload();
    client.close();
}
Also used : Administration(org.wildfly.extras.creaper.core.online.operations.admin.Administration) OnlineManagementClient(org.wildfly.extras.creaper.core.online.OnlineManagementClient)

Example 4 with Administration

use of org.wildfly.extras.creaper.core.online.operations.admin.Administration 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 5 with Administration

use of org.wildfly.extras.creaper.core.online.operations.admin.Administration in project keycloak by keycloak.

the class ClientSearchTest method executeCli.

private void executeCli(String... commands) throws Exception {
    OnlineManagementClient client = AuthServerTestEnricher.getManagementClient();
    Administration administration = new Administration(client);
    log.debug("Running CLI commands:");
    for (String c : commands) {
        log.debug(c);
        client.execute(c).assertSuccess();
    }
    log.debug("Done");
    administration.reload();
    client.close();
}
Also used : Administration(org.wildfly.extras.creaper.core.online.operations.admin.Administration) OnlineManagementClient(org.wildfly.extras.creaper.core.online.OnlineManagementClient)

Aggregations

Administration (org.wildfly.extras.creaper.core.online.operations.admin.Administration)9 OnlineManagementClient (org.wildfly.extras.creaper.core.online.OnlineManagementClient)7 Operations (org.wildfly.extras.creaper.core.online.operations.Operations)3 StartContainer (org.jboss.arquillian.container.spi.event.StartContainer)2 StopContainer (org.jboss.arquillian.container.spi.event.StopContainer)2 Before (org.junit.Before)2 IOException (java.io.IOException)1 TimeoutException (java.util.concurrent.TimeoutException)1 CliException (org.wildfly.extras.creaper.core.online.CliException)1