Search in sources :

Example 21 with Pipeline

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));
}
Also used : JobInstance(com.thoughtworks.go.domain.JobInstance) Stage(com.thoughtworks.go.domain.Stage) JobIdentifier(com.thoughtworks.go.domain.JobIdentifier) Pipeline(com.thoughtworks.go.domain.Pipeline) Test(org.junit.Test)

Example 22 with Pipeline

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()));
}
Also used : Pipeline(com.thoughtworks.go.domain.Pipeline) Test(org.junit.Test)

Example 23 with Pipeline

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()));
}
Also used : Pipeline(com.thoughtworks.go.domain.Pipeline) Test(org.junit.Test)

Example 24 with Pipeline

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;
}
Also used : NullStage(com.thoughtworks.go.domain.NullStage) Pipeline(com.thoughtworks.go.domain.Pipeline)

Example 25 with 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;
}
Also used : NullStage(com.thoughtworks.go.domain.NullStage) Stage(com.thoughtworks.go.domain.Stage) Pipeline(com.thoughtworks.go.domain.Pipeline)

Aggregations

Pipeline (com.thoughtworks.go.domain.Pipeline)177 Test (org.junit.jupiter.api.Test)73 Test (org.junit.Test)55 Stage (com.thoughtworks.go.domain.Stage)40 JobInstance (com.thoughtworks.go.domain.JobInstance)26 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)23 Username (com.thoughtworks.go.server.domain.Username)17 ServerHealthStateOperationResult (com.thoughtworks.go.server.service.result.ServerHealthStateOperationResult)16 MaterialRevisions (com.thoughtworks.go.domain.MaterialRevisions)14 PipelineConfig (com.thoughtworks.go.config.PipelineConfig)12 JobIdentifier (com.thoughtworks.go.domain.JobIdentifier)12 StageIdentifier (com.thoughtworks.go.domain.StageIdentifier)11 MaterialRevision (com.thoughtworks.go.domain.MaterialRevision)10 ModelAndView (org.springframework.web.servlet.ModelAndView)10 MaterialConfigs (com.thoughtworks.go.config.materials.MaterialConfigs)9 DependencyMaterial (com.thoughtworks.go.config.materials.dependency.DependencyMaterial)9 Modification (com.thoughtworks.go.domain.materials.Modification)9 DependencyMaterialConfig (com.thoughtworks.go.config.materials.dependency.DependencyMaterialConfig)7 PipelineState (com.thoughtworks.go.domain.PipelineState)6 HttpLocalizedOperationResult (com.thoughtworks.go.server.service.result.HttpLocalizedOperationResult)6