use of com.thoughtworks.go.domain.builder.FetchPluggableArtifactBuilder in project gocd by gocd.
the class FetchTaskBuilderTest method FetchPluggableArtifactTask_shouldUseCorrectStageCounterWhenFetchingFromSamePipelineAndStageThatHasBeenRun.
@Test
public void FetchPluggableArtifactTask_shouldUseCorrectStageCounterWhenFetchingFromSamePipelineAndStageThatHasBeenRun() {
FetchPluggableArtifactTask fetchTask = new FetchPluggableArtifactTask(new CaseInsensitiveString("uppest_stream"), new CaseInsensitiveString("uppest-stage1"), new CaseInsensitiveString("uppest-job1"), "installer");
Pipeline pipeline = pipelineWithStage("uppest_stream", 1, "label-1", "uppest-stage1", 2);
FetchPluggableArtifactBuilder builder = (FetchPluggableArtifactBuilder) fetchTaskBuilder.createBuilder(builderFactory, fetchTask, pipeline, resolver);
assertThat(builder.getJobIdentifier(), Matchers.is(new JobIdentifier("uppest_stream", 1, "label-1", "uppest-stage1", "2", "uppest-job1", 0L)));
}
use of com.thoughtworks.go.domain.builder.FetchPluggableArtifactBuilder in project gocd by gocd.
the class FetchTaskBuilderTest method FetchPluggableArtifactTask_shouldGetTheRightDestAndJobLocatorOnAgent.
@Test
public void FetchPluggableArtifactTask_shouldGetTheRightDestAndJobLocatorOnAgent() {
Pipeline pipeline = pipelineWithDepencencyMaterial("cruise", "uppest_stream", 1, "10", "uppest_stage1", 2);
FetchPluggableArtifactTask fetchTask = new FetchPluggableArtifactTask(new CaseInsensitiveString("uppest_stream"), new CaseInsensitiveString("uppest-stage1"), new CaseInsensitiveString("uppest-job1"), "installer");
FetchPluggableArtifactBuilder builder = (FetchPluggableArtifactBuilder) fetchTaskBuilder.createBuilder(builderFactory, fetchTask, pipeline, resolver);
assertThat(builder.getJobIdentifier().buildLocatorForDisplay(), is("uppest_stream/10/uppest-stage1/latest/uppest-job1"));
}
use of com.thoughtworks.go.domain.builder.FetchPluggableArtifactBuilder in project gocd by gocd.
the class FetchTaskBuilderTest method FetchPluggableArtifactTask_shouldNormalizeDestOnAgent.
@Test
public void FetchPluggableArtifactTask_shouldNormalizeDestOnAgent() {
FetchPluggableArtifactTask fetchTask = new FetchPluggableArtifactTask(new CaseInsensitiveString("uppest_stream"), new CaseInsensitiveString("uppest-stage1"), new CaseInsensitiveString("uppest-job1"), "installer");
Pipeline pipeline = pipelineWithDepencencyMaterial("cruise", "uppest_stream", 1, "label-1", "uppest-stage1", 2);
FetchPluggableArtifactBuilder builder = (FetchPluggableArtifactBuilder) fetchTaskBuilder.createBuilder(builderFactory, fetchTask, pipeline, resolver);
final FileHandler expectedHandler = new FileHandler(new File("pipelines/cruise/cd.go.s3.json"), PLUGGABLE_ARTIFACT_METADATA_FOLDER + "/cd.go.s3.json");
assertThat(builder.getHandler(), is(expectedHandler));
}
use of com.thoughtworks.go.domain.builder.FetchPluggableArtifactBuilder in project gocd by gocd.
the class FetchTaskBuilderTest method FetchPluggableArtifactTask_shouldUseNameAndLabelFromPipelineWhenPipelineNameOfTaskIsEmpty.
@Test
public void FetchPluggableArtifactTask_shouldUseNameAndLabelFromPipelineWhenPipelineNameOfTaskIsEmpty() {
final PipelineConfig cruise = goConfigService.getCurrentConfig().pipelineConfigByName(new CaseInsensitiveString("cruise"));
cruise.getStage("stage").jobConfigByConfigName("job").artifactConfigs().add(new PluggableArtifactConfig("installer", "s3"));
FetchPluggableArtifactTask fetchTask = new FetchPluggableArtifactTask(null, new CaseInsensitiveString("stage"), new CaseInsensitiveString("job"), "installer");
Pipeline pipeline = pipeline(LABEL);
FetchPluggableArtifactBuilder builder = (FetchPluggableArtifactBuilder) fetchTaskBuilder.createBuilder(builderFactory, fetchTask, pipeline, resolver);
assertThat(builder.getJobIdentifier().getPipelineName(), is("cruise"));
assertThat(builder.getJobIdentifier().getPipelineLabel(), is(LABEL));
}
use of com.thoughtworks.go.domain.builder.FetchPluggableArtifactBuilder in project gocd by gocd.
the class FetchTaskBuilderTest method FetchPluggableArtifactTask_shouldUsePipelineCounterWhenFetchingArtifactFromDependentPipeline.
@Test
public void FetchPluggableArtifactTask_shouldUsePipelineCounterWhenFetchingArtifactFromDependentPipeline() {
FetchPluggableArtifactTask fetchTask = new FetchPluggableArtifactTask(new CaseInsensitiveString("uppest_stream"), new CaseInsensitiveString("uppest-stage1"), new CaseInsensitiveString("uppest-job1"), "installer");
Pipeline pipeline = pipelineWithDepencencyMaterial("cruise", "uppest_stream", 1, "label-1", "uppest-stage1", 2);
FetchPluggableArtifactBuilder builder = (FetchPluggableArtifactBuilder) fetchTaskBuilder.createBuilder(builderFactory, fetchTask, pipeline, resolver);
assertThat(builder.metadataFileLocator(), is("uppest_stream/1/uppest-stage1/2/uppest-job1/cd.go.s3.json"));
}
Aggregations