use of com.thoughtworks.go.config.remote.FileConfigOrigin in project gocd by gocd.
the class FetchTaskTest method validate_shouldNotErrorWhenReferencingFilePipelineFromConfigRepositoryPipeline.
@Test
public void validate_shouldNotErrorWhenReferencingFilePipelineFromConfigRepositoryPipeline() {
uppestStream.setOrigin(new FileConfigOrigin());
downstream.setOrigin(new RepoConfigOrigin());
FetchTask task = new FetchTask(new CaseInsensitiveString("uppest_stream/upstream"), new CaseInsensitiveString("uppest-stage2"), new CaseInsensitiveString("uppest-job2"), "src", "dest");
task.validate(ConfigSaveValidationContext.forChain(config, new BasicPipelineConfigs(), downstream, downstream.getStage(new CaseInsensitiveString("stage"))));
assertThat(task.errors().isEmpty(), is(true));
}
use of com.thoughtworks.go.config.remote.FileConfigOrigin in project gocd by gocd.
the class FetchTaskTest method validate_shouldErrorWhenReferencingConfigRepositoryPipelineFromFilePipeline.
@Test
public void validate_shouldErrorWhenReferencingConfigRepositoryPipelineFromFilePipeline() {
uppestStream.setOrigin(new RepoConfigOrigin());
downstream.setOrigin(new FileConfigOrigin());
FetchTask task = new FetchTask(new CaseInsensitiveString("uppest_stream/upstream"), new CaseInsensitiveString("uppest-stage2"), new CaseInsensitiveString("uppest-job2"), "src", "dest");
StageConfig stage = downstream.getStage(new CaseInsensitiveString("stage"));
task.validate(ConfigSaveValidationContext.forChain(config, new BasicPipelineConfigs(), downstream, stage, stage.getJobs().first()));
assertThat(task.errors().isEmpty(), is(false));
assertThat(task.errors().on(FetchTask.ORIGIN), startsWith("\"downstream :: stage :: job\" tries to fetch artifact from job \"uppest_stream :: uppest-stage2 :: uppest-job2\" which is defined in"));
}
use of com.thoughtworks.go.config.remote.FileConfigOrigin in project gocd by gocd.
the class BasicPipelineConfigsTest method shouldReturnSelfForGetLocalPartsWhenOriginIsFile.
@Test
public void shouldReturnSelfForGetLocalPartsWhenOriginIsFile() {
PipelineConfigs pipelineConfigs = createEmpty();
pipelineConfigs.setOrigins(new FileConfigOrigin());
assertThat(pipelineConfigs.getLocal().size(), is(0));
assertSame(pipelineConfigs, pipelineConfigs.getLocal());
}
use of com.thoughtworks.go.config.remote.FileConfigOrigin in project gocd by gocd.
the class PipelineConfigTest method shouldReturnFalseIfOneOfPipelineMaterialsIsTheSameAsConfigOrigin_WhenOriginIsFile.
@Test
public void shouldReturnFalseIfOneOfPipelineMaterialsIsTheSameAsConfigOrigin_WhenOriginIsFile() {
PipelineConfig pipelineConfig = PipelineConfigMother.createPipelineConfig("pipeline", "stage", "build");
pipelineConfig.setOrigin(new FileConfigOrigin());
assertThat(pipelineConfig.isConfigOriginSameAsOneOfMaterials(), is(false));
}
use of com.thoughtworks.go.config.remote.FileConfigOrigin in project gocd by gocd.
the class PipelineGroupsTest method shouldGetLocalPartsWhenOriginIsMixed.
@Test
public void shouldGetLocalPartsWhenOriginIsMixed() {
PipelineConfigs localGroup = createGroup("defaultGroup", createPipelineConfig("pipeline1", "stage1"));
localGroup.setOrigins(new FileConfigOrigin());
PipelineConfigs remoteGroup = createGroup("defaultGroup", createPipelineConfig("pipeline2", "stage1"));
remoteGroup.setOrigins(new RepoConfigOrigin());
MergePipelineConfigs mergePipelineConfigs = new MergePipelineConfigs(localGroup, remoteGroup);
PipelineGroups groups = new PipelineGroups(mergePipelineConfigs);
assertThat(groups.getLocal().size(), is(1));
assertThat(groups.getLocal(), hasItem(localGroup));
}
Aggregations