Search in sources :

Example 6 with ProviderTypeList

use of org.guvnor.ala.services.api.itemlist.ProviderTypeList in project kie-wb-common by kiegroup.

the class RuntimeEndpointsTestIT method checkOpenShiftService.

/**
 * Can be used if internal to red hat.
 * TODO: replace with more lightweight image and non-internal (minishift?) environment
 * @throws Exception
 */
@Ignore
public void checkOpenShiftService() throws Exception {
    Client client = ClientBuilder.newClient();
    WebTarget target = client.target(APP_URL);
    ResteasyWebTarget restEasyTarget = (ResteasyWebTarget) target;
    RuntimeProvisioningService proxy = restEasyTarget.proxy(RuntimeProvisioningService.class);
    ProviderTypeList allProviderTypes = proxy.getProviderTypes(0, 10, "", true);
    assertNotNull(allProviderTypes);
    assertEquals(3, allProviderTypes.getItems().size());
    OpenShiftProviderConfigImpl openshiftProviderConfig = createProviderConfig();
    proxy.registerProvider(openshiftProviderConfig);
    ProviderList allProviders = proxy.getProviders(0, 10, "", true);
    assertEquals(1, allProviders.getItems().size());
    assertTrue(allProviders.getItems().get(0) instanceof OpenShiftProvider);
    OpenShiftProvider openshiftProvider = (OpenShiftProvider) allProviders.getItems().get(0);
    OpenShiftRuntimeConfig runtimeConfig = createRuntimeConfig(openshiftProvider, "coss1");
    @SuppressWarnings("unused") OpenShiftRuntime openshiftRuntime = getOpenShiftRuntime(proxy, 0, null);
    String runtimeId = proxy.newRuntime(runtimeConfig);
    openshiftRuntime = getOpenShiftRuntime(proxy, 1, OpenShiftRuntimeState.READY);
    proxy.startRuntime(runtimeId);
    openshiftRuntime = getOpenShiftRuntime(proxy, 1, OpenShiftRuntimeState.RUNNING);
    proxy.stopRuntime(runtimeId);
    openshiftRuntime = getOpenShiftRuntime(proxy, 1, OpenShiftRuntimeState.READY);
    proxy.destroyRuntime(runtimeId, true);
    openshiftRuntime = getOpenShiftRuntime(proxy, 0, null);
}
Also used : ProviderList(org.guvnor.ala.services.api.itemlist.ProviderList) RuntimeProvisioningService(org.guvnor.ala.services.api.RuntimeProvisioningService) OpenShiftRuntime(org.guvnor.ala.openshift.model.OpenShiftRuntime) ResteasyWebTarget(org.jboss.resteasy.client.jaxrs.ResteasyWebTarget) OpenShiftProvider(org.guvnor.ala.openshift.model.OpenShiftProvider) ResteasyWebTarget(org.jboss.resteasy.client.jaxrs.ResteasyWebTarget) WebTarget(javax.ws.rs.client.WebTarget) Client(javax.ws.rs.client.Client) OpenShiftProviderConfigImpl(org.guvnor.ala.openshift.config.impl.OpenShiftProviderConfigImpl) ProviderTypeList(org.guvnor.ala.services.api.itemlist.ProviderTypeList) OpenShiftRuntimeConfig(org.guvnor.ala.openshift.config.OpenShiftRuntimeConfig) Ignore(org.junit.Ignore)

Aggregations

ProviderTypeList (org.guvnor.ala.services.api.itemlist.ProviderTypeList)6 ProviderList (org.guvnor.ala.services.api.itemlist.ProviderList)5 DockerProviderConfig (org.guvnor.ala.docker.config.DockerProviderConfig)4 DockerProvider (org.guvnor.ala.docker.model.DockerProvider)4 RuntimeList (org.guvnor.ala.services.api.itemlist.RuntimeList)4 Client (javax.ws.rs.client.Client)3 WebTarget (javax.ws.rs.client.WebTarget)3 DockerProviderConfigImpl (org.guvnor.ala.docker.config.impl.DockerProviderConfigImpl)3 RuntimeProvisioningService (org.guvnor.ala.services.api.RuntimeProvisioningService)3 ResteasyWebTarget (org.jboss.resteasy.client.jaxrs.ResteasyWebTarget)3 Ignore (org.junit.Ignore)3 Test (org.junit.Test)3 ArrayList (java.util.ArrayList)2 MavenBuildConfigImpl (org.guvnor.ala.build.maven.config.impl.MavenBuildConfigImpl)2 MavenBuildExecConfigImpl (org.guvnor.ala.build.maven.config.impl.MavenBuildExecConfigImpl)2 MavenProjectConfigImpl (org.guvnor.ala.build.maven.config.impl.MavenProjectConfigImpl)2 DockerRuntimeConfig (org.guvnor.ala.docker.config.DockerRuntimeConfig)2 ContextAwareDockerProvisioningConfig (org.guvnor.ala.docker.config.impl.ContextAwareDockerProvisioningConfig)2 ContextAwareDockerRuntimeExecConfig (org.guvnor.ala.docker.config.impl.ContextAwareDockerRuntimeExecConfig)2 DockerBuildConfigImpl (org.guvnor.ala.docker.config.impl.DockerBuildConfigImpl)2