Search in sources :

Example 31 with BasicCruiseConfig

use of com.thoughtworks.go.config.BasicCruiseConfig 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

BasicCruiseConfig (com.thoughtworks.go.config.BasicCruiseConfig)31 Test (org.junit.Test)28 CruiseConfig (com.thoughtworks.go.config.CruiseConfig)18 ServerConfig (com.thoughtworks.go.config.ServerConfig)10 BasicPipelineConfigs (com.thoughtworks.go.config.BasicPipelineConfigs)4 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)4 PipelineConfig (com.thoughtworks.go.config.PipelineConfig)4 ServerSiteUrlConfig (com.thoughtworks.go.domain.ServerSiteUrlConfig)4 SystemEnvironment (com.thoughtworks.go.util.SystemEnvironment)4 ConfigSaveValidationContext (com.thoughtworks.go.config.ConfigSaveValidationContext)3 SecurityConfig (com.thoughtworks.go.config.SecurityConfig)3 ValidationError (com.thoughtworks.go.plugin.api.response.validation.ValidationError)3 ValidationResult (com.thoughtworks.go.plugin.api.response.validation.ValidationResult)3 GoConfigService (com.thoughtworks.go.server.service.GoConfigService)3 HttpLocalizedOperationResult (com.thoughtworks.go.server.service.result.HttpLocalizedOperationResult)3 PluginRoleConfig (com.thoughtworks.go.config.PluginRoleConfig)2 SecurityAuthConfig (com.thoughtworks.go.config.SecurityAuthConfig)2 ElasticProfile (com.thoughtworks.go.config.elastic.ElasticProfile)2 MaterialConfigs (com.thoughtworks.go.config.materials.MaterialConfigs)2 ConfigurationKey (com.thoughtworks.go.domain.config.ConfigurationKey)2