use of com.thoughtworks.go.config.remote.FileConfigOrigin in project gocd by gocd.
the class FetchPluggableArtifactTaskTest method validate_shouldNotErrorWhenReferencingFilePipelineFromFilePipeline.
@Test
public void validate_shouldNotErrorWhenReferencingFilePipelineFromFilePipeline() {
uppestStream.getStage("uppest-stage2").jobConfigByConfigName("uppest-job2").artifactConfigs().add(new PluggableArtifactConfig("s3", "cd.go.s3"));
uppestStream.setOrigin(new FileConfigOrigin());
downstream.setOrigin(new FileConfigOrigin());
FetchPluggableArtifactTask task = new FetchPluggableArtifactTask(new CaseInsensitiveString("uppest_stream/upstream"), new CaseInsensitiveString("uppest-stage2"), new CaseInsensitiveString("uppest-job2"), "s3");
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 FetchPluggableArtifactTaskTest method validate_shouldNotErrorWhenReferencingFilePipelineFromConfigRepositoryPipeline.
@Test
public void validate_shouldNotErrorWhenReferencingFilePipelineFromConfigRepositoryPipeline() {
uppestStream.getStage("uppest-stage2").jobConfigByConfigName("uppest-job2").artifactConfigs().add(new PluggableArtifactConfig("s3", "cd.go.s3"));
uppestStream.setOrigin(new FileConfigOrigin());
downstream.setOrigin(new RepoConfigOrigin());
FetchPluggableArtifactTask task = new FetchPluggableArtifactTask(new CaseInsensitiveString("uppest_stream/upstream"), new CaseInsensitiveString("uppest-stage2"), new CaseInsensitiveString("uppest-job2"), "s3");
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 FullConfigSaveFlow method postValidationUpdates.
protected void postValidationUpdates(CruiseConfig configForEdit, String xmlString) throws NoSuchFieldException, IllegalAccessException {
String md5 = CachedDigestUtils.md5Hex(xmlString);
configForEdit.setOrigins(new FileConfigOrigin());
MagicalGoConfigXmlLoader.setMd5(configForEdit, md5);
}
use of com.thoughtworks.go.config.remote.FileConfigOrigin in project gocd by gocd.
the class DependencyMaterialConfigTest method shouldValidateTree.
@Test
public void shouldValidateTree() {
DependencyMaterialConfig dependencyMaterialConfig = new DependencyMaterialConfig(new CaseInsensitiveString("upstream_stage"), new CaseInsensitiveString("upstream_pipeline"), new CaseInsensitiveString("stage"));
PipelineConfig pipeline = new PipelineConfig(new CaseInsensitiveString("p"), new MaterialConfigs());
pipeline.setOrigin(new FileConfigOrigin());
dependencyMaterialConfig.validateTree(PipelineConfigSaveValidationContext.forChain(true, "group", config, pipeline));
assertThat(dependencyMaterialConfig.errors().on(DependencyMaterialConfig.PIPELINE_STAGE_NAME), is("Pipeline with name 'upstream_pipeline' does not exist, it is defined as a dependency for pipeline 'p' (cruise-config.xml)"));
}
Aggregations