Search in sources :

Example 1 with NullStage

use of com.thoughtworks.go.domain.NullStage in project gocd by gocd.

the class FetchTaskTest method pipeline.

private Pipeline pipeline(String label) {
    Pipeline pipeline = createPipeline("cruise", new NullStage("Stage"));
    pipeline.setLabel(label);
    return pipeline;
}
Also used : NullStage(com.thoughtworks.go.domain.NullStage) Pipeline(com.thoughtworks.go.domain.Pipeline)

Example 2 with NullStage

use of com.thoughtworks.go.domain.NullStage in project gocd by gocd.

the class UnrunStagesPopulatorTest method assertUnrunPipeline.

private void assertUnrunPipeline(Node node, String pipelineName) {
    assertThat(node.revisions(), hasSize(1));
    PipelineRevision empty_p2_revision = (PipelineRevision) node.revisions().get(0);
    assertThat(empty_p2_revision.getPipelineIdentifier(), is(new UnrunPipelineRevision(pipelineName).getPipelineIdentifier()));
    assertThat(empty_p2_revision.getStages(), is(new Stages(new NullStage("s1"), new NullStage("s2"), new NullStage("s3"), new NullStage("s4"))));
}
Also used : NullStage(com.thoughtworks.go.domain.NullStage) Stages(com.thoughtworks.go.domain.Stages)

Example 3 with NullStage

use of com.thoughtworks.go.domain.NullStage in project gocd by gocd.

the class CcTrayStageStatusChangeHandlerTest method shouldNotUpdateCacheWhenStageWhichHasChangedIsANullStage.

@Test
public void shouldNotUpdateCacheWhenStageWhichHasChangedIsANullStage() throws Exception {
    handler.call(new NullStage("some-name"));
    verifyZeroInteractions(cache);
    verifyZeroInteractions(breakersCalculator);
    verifyZeroInteractions(jobStatusChangeHandler);
}
Also used : NullStage(com.thoughtworks.go.domain.NullStage) Test(org.junit.Test)

Example 4 with NullStage

use of com.thoughtworks.go.domain.NullStage in project gocd by gocd.

the class UnrunStagesPopulator method populateConfiguredStages.

private void populateConfiguredStages(Node node, PipelineConfig pipelineConfig) {
    UnrunPipelineRevision unrunPipelineRevision = new UnrunPipelineRevision(node.getName());
    for (StageConfig stageConfig : pipelineConfig) {
        unrunPipelineRevision.addStage(new NullStage(stageConfig.name().toString()));
    }
    node.addRevision(unrunPipelineRevision);
}
Also used : NullStage(com.thoughtworks.go.domain.NullStage) StageConfig(com.thoughtworks.go.config.StageConfig)

Example 5 with NullStage

use of com.thoughtworks.go.domain.NullStage in project gocd by gocd.

the class UnrunStagesPopulator method appendUnrunStages.

private void appendUnrunStages(PipelineConfig pipelineConfig, PipelineRevision pipelineRevision) {
    Stages stages = pipelineRevision.getStages();
    StageConfig nextStage = pipelineConfig.nextStage(new CaseInsensitiveString(stages.last().getName()));
    while (nextStage != null && !stages.hasStage(nextStage.name().toString())) {
        pipelineRevision.addStage(new NullStage(nextStage.name().toString()));
        nextStage = pipelineConfig.nextStage(nextStage.name());
    }
}
Also used : NullStage(com.thoughtworks.go.domain.NullStage) Stages(com.thoughtworks.go.domain.Stages) StageConfig(com.thoughtworks.go.config.StageConfig) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString)

Aggregations

NullStage (com.thoughtworks.go.domain.NullStage)6 StageConfig (com.thoughtworks.go.config.StageConfig)2 Pipeline (com.thoughtworks.go.domain.Pipeline)2 Stages (com.thoughtworks.go.domain.Stages)2 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)1 Test (org.junit.Test)1