use of org.guvnor.ala.openshift.config.OpenShiftRuntimeConfig 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);
}
use of org.guvnor.ala.openshift.config.OpenShiftRuntimeConfig in project kie-wb-common by kiegroup.
the class OpenShiftRuntimeMarshallerTest method getValue.
@Override
public OpenShiftRuntime getValue() {
OpenShiftProvider providerId = createOpenShiftProvider();
OpenShiftRuntimeConfig runtimeConfig = new ContextAwareOpenShiftRuntimeExecConfig(RUNTIME_NAME, providerId, APPLICATION_NAME, KIE_SERVER_CONTAINER_DEPLOYMENT, PROJECT_NAME, RESOURCE_SECRETS_URI, RESOURCE_STREAMS_URI, RESOURCE_TEMPLATE_NAME, RESOURCE_TEMPLATE_PARAM_DELIMITER, RESOURCE_TEMPLATE_PARAM_ASSIGNER, RESOURCE_TEMPLATE_PARAM_VALUES, RESOURCE_TEMPLATE_URI, SERVICE_NAME);
return new OpenShiftRuntime(RUNTIME_ID, RUNTIME_NAME, runtimeConfig, providerId, new OpenShiftRuntimeEndpoint(PROTOCOL, HOST, PORT, CONTEXT), new OpenShiftRuntimeInfo(runtimeConfig), new OpenShiftRuntimeState(STATE, STARTED_AT));
}
Aggregations