Search in sources :

Example 1 with MavenProjectConfigImpl

use of org.guvnor.ala.build.maven.config.impl.MavenProjectConfigImpl in project kie-wb-common by kiegroup.

the class RestPipelineImplTest method testAPI.

@Test
public void testAPI() {
    ProviderTypeList allProviderTypes = runtimeService.getProviderTypes(0, 10, "", true);
    assertEquals(2, allProviderTypes.getItems().size());
    DockerProviderConfig dockerProviderConfig = new DockerProviderConfig() {
    };
    runtimeService.registerProvider(dockerProviderConfig);
    ProviderList allProviders = runtimeService.getProviders(0, 10, "", true);
    assertEquals(1, allProviders.getItems().size());
    Provider p = allProviders.getItems().get(0);
    assertTrue(p instanceof DockerProvider);
    // by construction.
    int systemPipelines = 2;
    PipelineConfigsList allPipelineConfigs = pipelineService.getPipelineConfigs(0, 10, "", true);
    assertNotNull(allPipelineConfigs);
    assertEquals(systemPipelines, allPipelineConfigs.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("MavenBuildExecConfigImpl", new MavenBuildExecConfigImpl()));
    configs.add(new PipelineConfigStage("DockerProviderConfig", new DockerProviderConfigImpl()));
    configs.add(new PipelineConfigStage("ContextAwareDockerProvisioningConfig", new ContextAwareDockerProvisioningConfig()));
    configs.add(new PipelineConfigStage("ContextAwareDockerRuntimeExecConfig", new ContextAwareDockerRuntimeExecConfig()));
    pipelineService.newPipeline(new PipelineConfigImpl("mypipe", configs));
    pipelineService.newPipeline(new PipelineConfigImpl("wildlfyPipe", configs), WildflyProviderType.instance());
    pipelineService.newPipeline(new PipelineConfigImpl("dockerPipe", configs), DockerProviderType.instance());
    allPipelineConfigs = pipelineService.getPipelineConfigs(0, 10, "", true);
    int createdPipelines = 3;
    int totalPipelines = systemPipelines + createdPipelines;
    assertEquals(totalPipelines, allPipelineConfigs.getItems().size());
    PipelineConfigsList wildflyConfigs = pipelineService.getPipelineConfigs(WildflyProviderType.instance().getProviderTypeName(), WildflyProviderType.instance().getVersion(), 0, 10, "", true);
    assertEquals(2, wildflyConfigs.getItems().size());
    List<String> wildflyPipelineNames = pipelineService.getPipelineNames(WildflyProviderType.instance().getProviderTypeName(), WildflyProviderType.instance().getVersion(), 0, 10, "", true);
    assertEquals(2, wildflyPipelineNames.size());
    assertTrue(wildflyPipelineNames.contains("wildlfyPipe"));
    assertTrue(wildflyPipelineNames.contains(SYSTEM_PIPELINE1));
    PipelineConfigsList dockerConfigs = pipelineService.getPipelineConfigs(DockerProviderType.instance().getProviderTypeName(), DockerProviderType.instance().getVersion(), 0, 10, "", true);
    assertEquals(1, dockerConfigs.getItems().size());
    List<String> dockerPipelineNames = pipelineService.getPipelineNames(DockerProviderType.instance().getProviderTypeName(), DockerProviderType.instance().getVersion(), 0, 10, "", true);
    assertEquals(1, dockerPipelineNames.size());
    assertTrue(dockerPipelineNames.contains("dockerPipe"));
    Input input = new Input();
    input.put("provider-name", "local");
    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);
    String pipelineExecutionId = pipelineService.runPipeline("mypipe", input, false);
    RuntimeQueryResultItemList itemList = runtimeService.executeQuery(RuntimeQueryBuilder.newInstance().withPipelineExecutionId(pipelineExecutionId).build());
    assertEquals(1, itemList.getItems().size());
    assertEquals(pipelineExecutionId, itemList.getItems().get(0).getPipelineExecutionId());
    pipelineService.deletePipelineExecution(pipelineExecutionId);
    itemList = runtimeService.executeQuery(RuntimeQueryBuilder.newInstance().withPipelineExecutionId(pipelineExecutionId).build());
    assertEquals(1, itemList.getItems().size());
    assertNull(itemList.getItems().get(0).getPipelineExecutionId());
    RuntimeList allRuntimes = runtimeService.getRuntimes(0, 10, "", true);
    assertEquals(1, allRuntimes.getItems().size());
    runtimeService.destroyRuntime(allRuntimes.getItems().get(0).getId(), true);
    allRuntimes = runtimeService.getRuntimes(0, 10, "", true);
    assertEquals(0, allRuntimes.getItems().size());
    assertEquals(18, // 8 Stages x 2 + 2 pipeline events
    listener.getEvents().size());
    pipelineExecutionId = pipelineService.runPipeline("mypipe", input, true);
    pipelineService.stopPipelineExecution(pipelineExecutionId);
    itemList = runtimeService.executeQuery(RuntimeQueryBuilder.newInstance().withPipelineExecutionId(pipelineExecutionId).build());
    assertEquals(1, itemList.getItems().size());
    assertEquals(pipelineExecutionId, itemList.getItems().get(0).getPipelineExecutionId());
    assertEquals(PipelineExecutorTask.Status.STOPPED.name(), itemList.getItems().get(0).getPipelineStatus());
}
Also used : RuntimeQueryResultItemList(org.guvnor.ala.services.api.itemlist.RuntimeQueryResultItemList) 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) DockerProvider(org.guvnor.ala.docker.model.DockerProvider) GitConfigImpl(org.guvnor.ala.source.git.config.impl.GitConfigImpl) ArrayList(java.util.ArrayList) DockerProviderConfigImpl(org.guvnor.ala.docker.config.impl.DockerProviderConfigImpl) DockerProviderConfig(org.guvnor.ala.docker.config.DockerProviderConfig) ProviderTypeList(org.guvnor.ala.services.api.itemlist.ProviderTypeList) DockerProvider(org.guvnor.ala.docker.model.DockerProvider) Provider(org.guvnor.ala.runtime.providers.Provider) Input(org.guvnor.ala.pipeline.Input) PipelineConfigStage(org.guvnor.ala.pipeline.PipelineConfigStage) MavenBuildExecConfigImpl(org.guvnor.ala.build.maven.config.impl.MavenBuildExecConfigImpl) 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) PipelineConfigImpl(org.guvnor.ala.pipeline.impl.PipelineConfigImpl) ContextAwareDockerRuntimeExecConfig(org.guvnor.ala.docker.config.impl.ContextAwareDockerRuntimeExecConfig) Test(org.junit.Test)

Example 2 with MavenProjectConfigImpl

use of org.guvnor.ala.build.maven.config.impl.MavenProjectConfigImpl in project kie-wb-common by kiegroup.

the class MavenProjectConfigExecutorTest method testAPI.

@Test
public void testAPI() {
    final SourceRegistry sourceRegistry = new InMemorySourceRegistry();
    final BuildRegistry buildRegistry = new InMemoryBuildRegistry();
    final Pipeline pipe = PipelineFactory.newBuilder().addConfigStage("Git Source", new MyGitConfig()).addConfigStage("Maven Project", new MavenProjectConfigImpl()).addConfigStage("Maven Build Config", new MavenBuildConfigImpl()).addConfigStage("Maven Build", new MavenBuildExecConfigImpl()).buildAs("my pipe");
    final PipelineExecutor executor = new PipelineExecutor(asList(new GitConfigExecutor(sourceRegistry), new MavenProjectConfigExecutor(sourceRegistry), new MavenBuildConfigExecutor(), new MavenBuildExecConfigExecutor(buildRegistry)));
    executor.execute(new Input() {

        {
            put("repo-name", "drools-workshop-pipe");
            put("create-repo", "true");
            put("branch", "master");
            put("out-dir", tempPath.getAbsolutePath());
            put("origin", gitUrl);
        }
    }, pipe, System.out::println);
    List<Repository> allRepositories = sourceRegistry.getAllRepositories();
    assertEquals(1, allRepositories.size());
    Repository repo = allRepositories.get(0);
    List<Project> allProjects = sourceRegistry.getAllProjects(repo);
    assertEquals(1, allProjects.size());
    List<Binary> allBinaries = buildRegistry.getAllBinaries();
    assertEquals(1, allBinaries.size());
    assertMavenBinary(allBinaries.get(0), allProjects.get(0));
    final String tempDir = sourceRegistry.getAllProjects(repo).get(0).getTempDir();
    executor.execute(new Input() {

        {
            put("project-temp-dir", tempDir);
            put("repo-name", "drools-workshop-pipe");
            put("branch", "master");
        }
    }, pipe, System.out::println);
    allRepositories = sourceRegistry.getAllRepositories();
    assertEquals(1, allRepositories.size());
    repo = allRepositories.get(0);
    allProjects = sourceRegistry.getAllProjects(repo);
    assertEquals(2, allProjects.size());
    allBinaries = buildRegistry.getAllBinaries();
    assertEquals(1, allBinaries.size());
    assertMavenBinary(allBinaries.get(0), allProjects.get(1));
}
Also used : InMemoryBuildRegistry(org.guvnor.ala.registry.inmemory.InMemoryBuildRegistry) MavenProjectConfigImpl(org.guvnor.ala.build.maven.config.impl.MavenProjectConfigImpl) InMemorySourceRegistry(org.guvnor.ala.registry.inmemory.InMemorySourceRegistry) SourceRegistry(org.guvnor.ala.registry.SourceRegistry) PipelineExecutor(org.guvnor.ala.pipeline.execution.PipelineExecutor) Pipeline(org.guvnor.ala.pipeline.Pipeline) Project(org.guvnor.ala.build.Project) MavenProject(org.apache.maven.project.MavenProject) GitConfigExecutor(org.guvnor.ala.source.git.executor.GitConfigExecutor) Input(org.guvnor.ala.pipeline.Input) Repository(org.guvnor.ala.source.Repository) InMemorySourceRegistry(org.guvnor.ala.registry.inmemory.InMemorySourceRegistry) MavenBuildExecConfigImpl(org.guvnor.ala.build.maven.config.impl.MavenBuildExecConfigImpl) BuildRegistry(org.guvnor.ala.registry.BuildRegistry) InMemoryBuildRegistry(org.guvnor.ala.registry.inmemory.InMemoryBuildRegistry) MavenBuildConfigImpl(org.guvnor.ala.build.maven.config.impl.MavenBuildConfigImpl) Binary(org.guvnor.ala.build.Binary) MavenBinary(org.guvnor.ala.build.maven.model.MavenBinary) Test(org.junit.Test)

Example 3 with MavenProjectConfigImpl

use of org.guvnor.ala.build.maven.config.impl.MavenProjectConfigImpl 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)

Example 4 with MavenProjectConfigImpl

use of org.guvnor.ala.build.maven.config.impl.MavenProjectConfigImpl in project kie-wb-common by kiegroup.

the class DockerExecutorTest method testAPI.

@Test
public void testAPI() throws InterruptedException {
    final SourceRegistry sourceRegistry = new InMemorySourceRegistry();
    final BuildRegistry buildRegistry = new InMemoryBuildRegistry();
    final InMemoryRuntimeRegistry runtimeRegistry = new InMemoryRuntimeRegistry();
    final DockerAccessInterface dockerAccessInterface = new DockerAccessInterfaceImpl();
    final Pipeline pipe = PipelineFactory.newBuilder().addConfigStage("Git Source", new GitConfigImpl()).addConfigStage("Maven Project", new MavenProjectConfigImpl()).addConfigStage("Maven Build Config", new MavenBuildConfigImpl()).addConfigStage("Docker Build Config", new DockerBuildConfigImpl()).addConfigStage("Maven Build", new MavenBuildExecConfigImpl()).addConfigStage("Docker Provider Config", new DockerProviderConfigImpl()).addConfigStage("Docker Runtime Config", new ContextAwareDockerProvisioningConfig()).addConfigStage("Docker Runtime Exec", new ContextAwareDockerRuntimeExecConfig()).buildAs("my pipe");
    DockerRuntimeExecExecutor dockerRuntimeExecExecutor = new DockerRuntimeExecExecutor(runtimeRegistry, dockerAccessInterface);
    final PipelineExecutor executor = new PipelineExecutor(asList(new GitConfigExecutor(sourceRegistry), new MavenProjectConfigExecutor(sourceRegistry), new MavenBuildConfigExecutor(), new MavenBuildExecConfigExecutor(buildRegistry), new DockerBuildConfigExecutor(), new DockerProviderConfigExecutor(runtimeRegistry), new DockerProvisioningConfigExecutor(), dockerRuntimeExecExecutor));
    executor.execute(new Input() {

        {
            put("repo-name", "drools-workshop");
            put("create-repo", "true");
            put("branch", "master");
            put("out-dir", tempPath.getAbsolutePath());
            put("origin", gitUrl);
        }
    }, pipe, (Runtime b) -> System.out.println(b));
    List<Runtime> allRuntimes = runtimeRegistry.getRuntimes(0, 10, "", true);
    assertEquals(1, allRuntimes.size());
    Runtime runtime = allRuntimes.get(0);
    assertTrue(runtime instanceof DockerRuntime);
    DockerRuntime dockerRuntime = (DockerRuntime) runtime;
    DockerRuntimeManager runtimeManager = new DockerRuntimeManager(runtimeRegistry, dockerAccessInterface);
    allRuntimes = runtimeRegistry.getRuntimes(0, 10, "", true);
    assertEquals(1, allRuntimes.size());
    runtime = allRuntimes.get(0);
    dockerRuntime = (DockerRuntime) runtime;
    assertEquals(RUNNING, dockerRuntime.getState().getState());
    runtimeManager.stop(dockerRuntime);
    allRuntimes = runtimeRegistry.getRuntimes(0, 10, "", true);
    assertEquals(1, allRuntimes.size());
    runtime = allRuntimes.get(0);
    dockerRuntime = (DockerRuntime) runtime;
    assertEquals(STOPPED, dockerRuntime.getState().getState());
    dockerRuntimeExecExecutor.destroy(runtime);
    dockerAccessInterface.dispose();
}
Also used : InMemoryBuildRegistry(org.guvnor.ala.registry.inmemory.InMemoryBuildRegistry) MavenProjectConfigExecutor(org.guvnor.ala.build.maven.executor.MavenProjectConfigExecutor) 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) InMemorySourceRegistry(org.guvnor.ala.registry.inmemory.InMemorySourceRegistry) SourceRegistry(org.guvnor.ala.registry.SourceRegistry) PipelineExecutor(org.guvnor.ala.pipeline.execution.PipelineExecutor) DockerRuntime(org.guvnor.ala.docker.model.DockerRuntime) Input(org.guvnor.ala.pipeline.Input) DockerRuntime(org.guvnor.ala.docker.model.DockerRuntime) Runtime(org.guvnor.ala.runtime.Runtime) DockerRuntimeManager(org.guvnor.ala.docker.service.DockerRuntimeManager) DockerAccessInterface(org.guvnor.ala.docker.access.DockerAccessInterface) BuildRegistry(org.guvnor.ala.registry.BuildRegistry) InMemoryBuildRegistry(org.guvnor.ala.registry.inmemory.InMemoryBuildRegistry) MavenBuildConfigImpl(org.guvnor.ala.build.maven.config.impl.MavenBuildConfigImpl) ContextAwareDockerRuntimeExecConfig(org.guvnor.ala.docker.config.impl.ContextAwareDockerRuntimeExecConfig) GitConfigImpl(org.guvnor.ala.source.git.config.impl.GitConfigImpl) DockerProviderConfigImpl(org.guvnor.ala.docker.config.impl.DockerProviderConfigImpl) DockerAccessInterfaceImpl(org.guvnor.ala.docker.access.impl.DockerAccessInterfaceImpl) Pipeline(org.guvnor.ala.pipeline.Pipeline) MavenBuildExecConfigExecutor(org.guvnor.ala.build.maven.executor.MavenBuildExecConfigExecutor) GitConfigExecutor(org.guvnor.ala.source.git.executor.GitConfigExecutor) InMemorySourceRegistry(org.guvnor.ala.registry.inmemory.InMemorySourceRegistry) MavenBuildExecConfigImpl(org.guvnor.ala.build.maven.config.impl.MavenBuildExecConfigImpl) InMemoryRuntimeRegistry(org.guvnor.ala.registry.inmemory.InMemoryRuntimeRegistry) MavenBuildConfigExecutor(org.guvnor.ala.build.maven.executor.MavenBuildConfigExecutor) Test(org.junit.Test)

Example 5 with MavenProjectConfigImpl

use of org.guvnor.ala.build.maven.config.impl.MavenProjectConfigImpl in project kie-wb-common by kiegroup.

the class MavenProjectConfigExecutorTest method testReuseTmpDirectoryAPI.

@Test
public void testReuseTmpDirectoryAPI() {
    final SourceRegistry sourceRegistry = new InMemorySourceRegistry();
    final BuildRegistry buildRegistry = new InMemoryBuildRegistry();
    final Pipeline pipe = PipelineFactory.newBuilder().addConfigStage("Git Source", new MyGitConfig()).addConfigStage("Maven Project", new MavenProjectConfigImpl()).addConfigStage("Maven Build Config", new MavenBuildConfigImpl()).addConfigStage("Maven Build", new MavenBuildExecConfigImpl()).buildAs("my pipe");
    final PipelineExecutor executor = new PipelineExecutor(asList(new GitConfigExecutor(sourceRegistry), new MavenProjectConfigExecutor(sourceRegistry), new MavenBuildConfigExecutor(), new MavenBuildExecConfigExecutor(buildRegistry)));
    executor.execute(new Input() {

        {
            put("repo-name", "drools-workshop-pipe2");
            put("create-repo", "true");
            put("branch", "master");
            put("out-dir", tempPath.getAbsolutePath());
            put("origin", gitUrl);
        }
    }, pipe, System.out::println);
    List<Repository> allRepositories = sourceRegistry.getAllRepositories();
    assertEquals(1, allRepositories.size());
    Repository repo = allRepositories.get(0);
    List<Project> allProjects = sourceRegistry.getAllProjects(repo);
    assertEquals(1, allProjects.size());
    List<Binary> allBinaries = buildRegistry.getAllBinaries();
    assertEquals(1, allBinaries.size());
    assertMavenBinary(allBinaries.get(0), allProjects.get(0));
    final String tempDir = sourceRegistry.getAllProjects(repo).get(0).getTempDir();
    executor.execute(new Input() {

        {
            put("project-temp-dir", tempDir);
            put("repo-name", "drools-workshop-pipe2");
            put("branch", "master");
        }
    }, pipe, System.out::println);
    allRepositories = sourceRegistry.getAllRepositories();
    assertEquals(1, allRepositories.size());
    repo = allRepositories.get(0);
    allProjects = sourceRegistry.getAllProjects(repo);
    assertEquals(2, allProjects.size());
    allBinaries = buildRegistry.getAllBinaries();
    assertEquals(1, allBinaries.size());
    assertMavenBinary(allBinaries.get(0), allProjects.get(1));
}
Also used : InMemoryBuildRegistry(org.guvnor.ala.registry.inmemory.InMemoryBuildRegistry) MavenProjectConfigImpl(org.guvnor.ala.build.maven.config.impl.MavenProjectConfigImpl) InMemorySourceRegistry(org.guvnor.ala.registry.inmemory.InMemorySourceRegistry) SourceRegistry(org.guvnor.ala.registry.SourceRegistry) PipelineExecutor(org.guvnor.ala.pipeline.execution.PipelineExecutor) Pipeline(org.guvnor.ala.pipeline.Pipeline) Project(org.guvnor.ala.build.Project) MavenProject(org.apache.maven.project.MavenProject) GitConfigExecutor(org.guvnor.ala.source.git.executor.GitConfigExecutor) Input(org.guvnor.ala.pipeline.Input) Repository(org.guvnor.ala.source.Repository) InMemorySourceRegistry(org.guvnor.ala.registry.inmemory.InMemorySourceRegistry) MavenBuildExecConfigImpl(org.guvnor.ala.build.maven.config.impl.MavenBuildExecConfigImpl) BuildRegistry(org.guvnor.ala.registry.BuildRegistry) InMemoryBuildRegistry(org.guvnor.ala.registry.inmemory.InMemoryBuildRegistry) MavenBuildConfigImpl(org.guvnor.ala.build.maven.config.impl.MavenBuildConfigImpl) Binary(org.guvnor.ala.build.Binary) MavenBinary(org.guvnor.ala.build.maven.model.MavenBinary) Test(org.junit.Test)

Aggregations

MavenProjectConfigImpl (org.guvnor.ala.build.maven.config.impl.MavenProjectConfigImpl)6 Input (org.guvnor.ala.pipeline.Input)6 MavenBuildConfigImpl (org.guvnor.ala.build.maven.config.impl.MavenBuildConfigImpl)5 MavenBuildExecConfigImpl (org.guvnor.ala.build.maven.config.impl.MavenBuildExecConfigImpl)5 Test (org.junit.Test)5 GitConfigImpl (org.guvnor.ala.source.git.config.impl.GitConfigImpl)4 ArrayList (java.util.ArrayList)3 ContextAwareDockerProvisioningConfig (org.guvnor.ala.docker.config.impl.ContextAwareDockerProvisioningConfig)3 ContextAwareDockerRuntimeExecConfig (org.guvnor.ala.docker.config.impl.ContextAwareDockerRuntimeExecConfig)3 DockerBuildConfigImpl (org.guvnor.ala.docker.config.impl.DockerBuildConfigImpl)3 DockerProviderConfigImpl (org.guvnor.ala.docker.config.impl.DockerProviderConfigImpl)3 Pipeline (org.guvnor.ala.pipeline.Pipeline)3 PipelineConfigStage (org.guvnor.ala.pipeline.PipelineConfigStage)3 PipelineExecutor (org.guvnor.ala.pipeline.execution.PipelineExecutor)3 PipelineConfigImpl (org.guvnor.ala.pipeline.impl.PipelineConfigImpl)3 BuildRegistry (org.guvnor.ala.registry.BuildRegistry)3 SourceRegistry (org.guvnor.ala.registry.SourceRegistry)3 InMemoryBuildRegistry (org.guvnor.ala.registry.inmemory.InMemoryBuildRegistry)3 InMemorySourceRegistry (org.guvnor.ala.registry.inmemory.InMemorySourceRegistry)3 GitConfigExecutor (org.guvnor.ala.source.git.executor.GitConfigExecutor)3