use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.
the class RestfulServiceTest method shouldReturnJobWithLabelWhenSpecifyPipelineLabel.
@Test
public void shouldReturnJobWithLabelWhenSpecifyPipelineLabel() throws Exception {
configHelper.setPipelineLabelTemplate(fixture.pipelineName, "label-${COUNT}");
Pipeline pipeline = fixture.createdPipelineWithAllStagesPassed();
Stage stage = pipeline.getStages().byName(fixture.devStage);
JobInstance job = stage.getJobInstances().first();
JobIdentifier result = restfulService.findJob(pipeline.getName(), pipeline.getLabel(), stage.getName(), String.valueOf(stage.getCounter()), job.getName(), job.getId());
JobIdentifier expect = new JobIdentifier(pipeline, stage, job);
assertThat(result, is(expect));
}
use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.
the class PipelineSchedulerIntegrationTest method shouldFindPipelineByLabel.
@Test
public void shouldFindPipelineByLabel() {
Pipeline pipeline = createPipelineWhoseLabelIsNumberAndNotSameWithCounter();
Pipeline actual = pipelineService.findPipelineByCounterOrLabel("Test", "10");
assertThat(actual.getId(), is(pipeline.getId()));
assertThat(actual.getLabel(), is(pipeline.getLabel()));
assertThat(actual.getCounter(), is(pipeline.getCounter()));
}
use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.
the class PipelineSchedulerIntegrationTest method shouldFindPipelineByCounter.
@Test
public void shouldFindPipelineByCounter() {
Pipeline pipeline = createNewPipeline();
Pipeline actual = pipelineService.findPipelineByCounterOrLabel("Test", pipeline.getCounter().toString());
assertThat(actual.getId(), is(pipeline.getId()));
assertThat(actual.getLabel(), is(pipeline.getLabel()));
assertThat(actual.getCounter(), is(pipeline.getCounter()));
}
use of com.thoughtworks.go.domain.Pipeline 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;
}
use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.
the class FetchTaskTest method pipelineWithStage.
private Pipeline pipelineWithStage(String pipelineName, int pipelineCounter, String label, String stagename, int stageCounter) {
Stage stage = StageMother.custom(stagename);
stage.setCounter(stageCounter);
Pipeline pipeline = createPipeline(pipelineName, stage);
pipeline.setCounter(pipelineCounter);
pipeline.setLabel(label);
return pipeline;
}
Aggregations