Search in sources :

Example 1 with OnlineManagementClient

use of org.wildfly.extras.creaper.core.online.OnlineManagementClient 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 OnlineManagementClient

use of org.wildfly.extras.creaper.core.online.OnlineManagementClient 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 OnlineManagementClient

use of org.wildfly.extras.creaper.core.online.OnlineManagementClient 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 OnlineManagementClient

use of org.wildfly.extras.creaper.core.online.OnlineManagementClient 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 OnlineManagementClient

use of org.wildfly.extras.creaper.core.online.OnlineManagementClient 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

OnlineManagementClient (org.wildfly.extras.creaper.core.online.OnlineManagementClient)8 Administration (org.wildfly.extras.creaper.core.online.operations.admin.Administration)7 IOException (java.io.IOException)2 StartContainer (org.jboss.arquillian.container.spi.event.StartContainer)2 StopContainer (org.jboss.arquillian.container.spi.event.StopContainer)2 Before (org.junit.Before)2 TimeoutException (java.util.concurrent.TimeoutException)1 ContainerDef (org.jboss.arquillian.config.descriptor.api.ContainerDef)1 Container (org.jboss.arquillian.container.spi.Container)1 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)1 WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)1 DropAllServlet (org.keycloak.helpers.DropAllServlet)1 RestartContainer (org.keycloak.testsuite.arquillian.annotation.RestartContainer)1 CommandFailedException (org.wildfly.extras.creaper.core.CommandFailedException)1 CliException (org.wildfly.extras.creaper.core.online.CliException)1 Operations (org.wildfly.extras.creaper.core.online.operations.Operations)1