Search in sources :

Example 91 with CruiseConfig

use of com.thoughtworks.go.config.CruiseConfig in project gocd by gocd.

the class UnrunStagesPopulatorTest method shouldPopulateUnrunStagesAndConfiguredStagesFromMaterial.

@Test
public void shouldPopulateUnrunStagesAndConfiguredStagesFromMaterial() throws Exception {
    /*
			git --> p1 --> p2
			 \
			  +-> p3
		 */
    GitMaterial gitMaterial = new GitMaterial("url");
    ValueStreamMap graph = new ValueStreamMap(gitMaterial, null, ModificationsMother.aCheckIn("r1"));
    Node git_node = graph.getCurrentMaterial();
    Node p1_node = graph.addDownstreamNode(new PipelineDependencyNode("p1", "p1"), git_node.getId());
    Node p2_node = graph.addDownstreamNode(new PipelineDependencyNode("p2", "p2"), "p1");
    Node p3_node = graph.addDownstreamNode(new PipelineDependencyNode("p3", "p3"), git_node.getId());
    addRevisions(p1_node);
    addRevisions(p3_node);
    CruiseConfig cruiseConfig = new BasicCruiseConfig();
    String group = "first";
    cruiseConfig.addPipeline(group, pipelineConfig("p"));
    cruiseConfig.addPipeline(group, pipelineConfig("p1"));
    cruiseConfig.addPipeline(group, pipelineConfig("p2"));
    cruiseConfig.addPipeline(group, pipelineConfig("p3"));
    when(goConfigService.getCurrentConfig()).thenReturn(cruiseConfig);
    unrunStagesPopulator.apply(graph);
    assertStages(p1_node);
    assertStages(p3_node);
    assertUnrunPipeline(p2_node, "p2");
}
Also used : GitMaterial(com.thoughtworks.go.config.materials.git.GitMaterial) BasicCruiseConfig(com.thoughtworks.go.config.BasicCruiseConfig) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString) CruiseConfig(com.thoughtworks.go.config.CruiseConfig) BasicCruiseConfig(com.thoughtworks.go.config.BasicCruiseConfig) Test(org.junit.Test)

Aggregations

CruiseConfig (com.thoughtworks.go.config.CruiseConfig)91 Test (org.junit.Test)71 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)53 GitMaterial (com.thoughtworks.go.config.materials.git.GitMaterial)33 MaterialRevisions (com.thoughtworks.go.domain.MaterialRevisions)33 BasicCruiseConfig (com.thoughtworks.go.config.BasicCruiseConfig)31 ServerConfig (com.thoughtworks.go.config.ServerConfig)11 PipelineConfig (com.thoughtworks.go.config.PipelineConfig)7 ConfigCache (com.thoughtworks.go.config.ConfigCache)5 MagicalGoConfigXmlLoader (com.thoughtworks.go.config.MagicalGoConfigXmlLoader)5 BuildCause (com.thoughtworks.go.domain.buildcause.BuildCause)5 ServerHealthStateOperationResult (com.thoughtworks.go.server.service.result.ServerHealthStateOperationResult)5 SystemEnvironment (com.thoughtworks.go.util.SystemEnvironment)5 SecurityConfig (com.thoughtworks.go.config.SecurityConfig)4 MaterialConfigs (com.thoughtworks.go.config.materials.MaterialConfigs)4 SvnMaterial (com.thoughtworks.go.config.materials.svn.SvnMaterial)4 MaterialRevision (com.thoughtworks.go.domain.MaterialRevision)4 ServerSiteUrlConfig (com.thoughtworks.go.domain.ServerSiteUrlConfig)4 File (java.io.File)4 GoConfigDao (com.thoughtworks.go.config.GoConfigDao)3