Search in sources :

Example 1 with PipelineService

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

the class PipelineEndpointsTestIT method checkService.

@Ignore
public void checkService() {
    Client client = ClientBuilder.newClient();
    WebTarget target = client.target(APP_URL);
    ResteasyWebTarget restEasyTarget = (ResteasyWebTarget) target;
    PipelineService proxyPipeline = restEasyTarget.proxy(PipelineService.class);
    RuntimeProvisioningService proxyRuntime = restEasyTarget.proxy(RuntimeProvisioningService.class);
    ProviderTypeList allProviderTypes = proxyRuntime.getProviderTypes(0, 10, "", true);
    assertNotNull(allProviderTypes);
    assertEquals(3, allProviderTypes.getItems().size());
    DockerProviderConfig dockerProviderConfig = new DockerProviderConfigImpl();
    proxyRuntime.registerProvider(dockerProviderConfig);
    ProviderList allProviders = proxyRuntime.getProviders(0, 10, "", true);
    assertEquals(1, allProviders.getItems().size());
    assertTrue(allProviders.getItems().get(0) instanceof DockerProvider);
    PipelineConfigsList allPipelines = proxyPipeline.getPipelineConfigs(0, 10, "", true);
    assertNotNull(allPipelines);
    assertEquals(0, allPipelines.getItems().size());
    List<PipelineConfigStage> configs = new ArrayList<>();
    configs.add(new PipelineConfigStage("GitConfig", new GitConfigImpl()));
    configs.add(new PipelineConfigStage("MavenProjectConfig", new MavenProjectConfigImpl()));
    configs.add(new PipelineConfigStage("MavenBuildConfig", new MavenBuildConfigImpl()));
    configs.add(new PipelineConfigStage("DockerBuildConfig", new DockerBuildConfigImpl()));
    configs.add(new PipelineConfigStage("MavenBuildExecConfig", new MavenBuildExecConfigImpl()));
    configs.add(new PipelineConfigStage("DockerProviderConfig", new DockerProviderConfigImpl()));
    configs.add(new PipelineConfigStage("ContextAwareDockerProvisioning", new ContextAwareDockerProvisioningConfig()));
    configs.add(new PipelineConfigStage("ContextAwareDockerRuntimeExec", new ContextAwareDockerRuntimeExecConfig()));
    String newPipeline = proxyPipeline.newPipeline(new PipelineConfigImpl("mypipe", configs));
    Input input = new Input();
    input.put("repo-name", "drools-workshop");
    input.put("create-repo", "true");
    input.put("branch", "master");
    input.put("out-dir", tempPath.getAbsolutePath());
    input.put("origin", gitUrl);
    proxyPipeline.runPipeline("mypipe", input, false);
    RuntimeList allRuntimes = proxyRuntime.getRuntimes(0, 10, "", true);
    assertEquals(1, allRuntimes.getItems().size());
    proxyRuntime.destroyRuntime(allRuntimes.getItems().get(0).getId(), true);
    allRuntimes = proxyRuntime.getRuntimes(0, 10, "", true);
    assertEquals(0, allRuntimes.getItems().size());
}
Also used : ProviderList(org.guvnor.ala.services.api.itemlist.ProviderList) MavenProjectConfigImpl(org.guvnor.ala.build.maven.config.impl.MavenProjectConfigImpl) ContextAwareDockerProvisioningConfig(org.guvnor.ala.docker.config.impl.ContextAwareDockerProvisioningConfig) DockerBuildConfigImpl(org.guvnor.ala.docker.config.impl.DockerBuildConfigImpl) ArrayList(java.util.ArrayList) DockerProviderConfig(org.guvnor.ala.docker.config.DockerProviderConfig) Input(org.guvnor.ala.pipeline.Input) PipelineConfigStage(org.guvnor.ala.pipeline.PipelineConfigStage) PipelineService(org.guvnor.ala.services.api.PipelineService) RuntimeList(org.guvnor.ala.services.api.itemlist.RuntimeList) PipelineConfigsList(org.guvnor.ala.services.api.itemlist.PipelineConfigsList) MavenBuildConfigImpl(org.guvnor.ala.build.maven.config.impl.MavenBuildConfigImpl) Client(javax.ws.rs.client.Client) ContextAwareDockerRuntimeExecConfig(org.guvnor.ala.docker.config.impl.ContextAwareDockerRuntimeExecConfig) DockerProvider(org.guvnor.ala.docker.model.DockerProvider) GitConfigImpl(org.guvnor.ala.source.git.config.impl.GitConfigImpl) DockerProviderConfigImpl(org.guvnor.ala.docker.config.impl.DockerProviderConfigImpl) ProviderTypeList(org.guvnor.ala.services.api.itemlist.ProviderTypeList) MavenBuildExecConfigImpl(org.guvnor.ala.build.maven.config.impl.MavenBuildExecConfigImpl) RuntimeProvisioningService(org.guvnor.ala.services.api.RuntimeProvisioningService) ResteasyWebTarget(org.jboss.resteasy.client.jaxrs.ResteasyWebTarget) ResteasyWebTarget(org.jboss.resteasy.client.jaxrs.ResteasyWebTarget) WebTarget(javax.ws.rs.client.WebTarget) PipelineConfigImpl(org.guvnor.ala.pipeline.impl.PipelineConfigImpl) Ignore(org.junit.Ignore)

Aggregations

ArrayList (java.util.ArrayList)1 Client (javax.ws.rs.client.Client)1 WebTarget (javax.ws.rs.client.WebTarget)1 MavenBuildConfigImpl (org.guvnor.ala.build.maven.config.impl.MavenBuildConfigImpl)1 MavenBuildExecConfigImpl (org.guvnor.ala.build.maven.config.impl.MavenBuildExecConfigImpl)1 MavenProjectConfigImpl (org.guvnor.ala.build.maven.config.impl.MavenProjectConfigImpl)1 DockerProviderConfig (org.guvnor.ala.docker.config.DockerProviderConfig)1 ContextAwareDockerProvisioningConfig (org.guvnor.ala.docker.config.impl.ContextAwareDockerProvisioningConfig)1 ContextAwareDockerRuntimeExecConfig (org.guvnor.ala.docker.config.impl.ContextAwareDockerRuntimeExecConfig)1 DockerBuildConfigImpl (org.guvnor.ala.docker.config.impl.DockerBuildConfigImpl)1 DockerProviderConfigImpl (org.guvnor.ala.docker.config.impl.DockerProviderConfigImpl)1 DockerProvider (org.guvnor.ala.docker.model.DockerProvider)1 Input (org.guvnor.ala.pipeline.Input)1 PipelineConfigStage (org.guvnor.ala.pipeline.PipelineConfigStage)1 PipelineConfigImpl (org.guvnor.ala.pipeline.impl.PipelineConfigImpl)1 PipelineService (org.guvnor.ala.services.api.PipelineService)1 RuntimeProvisioningService (org.guvnor.ala.services.api.RuntimeProvisioningService)1 PipelineConfigsList (org.guvnor.ala.services.api.itemlist.PipelineConfigsList)1 ProviderList (org.guvnor.ala.services.api.itemlist.ProviderList)1 ProviderTypeList (org.guvnor.ala.services.api.itemlist.ProviderTypeList)1