Search in sources :

Example 56 with FileConfigOrigin

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

Example 57 with FileConfigOrigin

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));
}
Also used : FileConfigOrigin(com.thoughtworks.go.config.remote.FileConfigOrigin) RepoConfigOrigin(com.thoughtworks.go.config.remote.RepoConfigOrigin) Test(org.junit.Test)

Example 58 with FileConfigOrigin

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);
}
Also used : FileConfigOrigin(com.thoughtworks.go.config.remote.FileConfigOrigin)

Example 59 with FileConfigOrigin

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)"));
}
Also used : MaterialConfigs(com.thoughtworks.go.config.materials.MaterialConfigs) FileConfigOrigin(com.thoughtworks.go.config.remote.FileConfigOrigin) DependencyMaterialConfig(com.thoughtworks.go.config.materials.dependency.DependencyMaterialConfig) Test(org.junit.Test)

Aggregations

FileConfigOrigin (com.thoughtworks.go.config.remote.FileConfigOrigin)59 Test (org.junit.Test)51 RepoConfigOrigin (com.thoughtworks.go.config.remote.RepoConfigOrigin)23 PipelineModel (com.thoughtworks.go.presentation.pipelinehistory.PipelineModel)5 MergeEnvironmentConfig (com.thoughtworks.go.config.merge.MergeEnvironmentConfig)4 ConfigRepoConfig (com.thoughtworks.go.config.remote.ConfigRepoConfig)4 Permissions (com.thoughtworks.go.config.security.Permissions)4 AllowedUsers (com.thoughtworks.go.config.security.users.AllowedUsers)4 BasicPipelineConfigs (com.thoughtworks.go.config.BasicPipelineConfigs)3 PipelineConfig (com.thoughtworks.go.config.PipelineConfig)3 PipelineConfigs (com.thoughtworks.go.config.PipelineConfigs)3 DependencyMaterialConfig (com.thoughtworks.go.config.materials.dependency.DependencyMaterialConfig)3 GitMaterialConfig (com.thoughtworks.go.config.materials.git.GitMaterialConfig)3 HttpLocalizedOperationResult (com.thoughtworks.go.server.service.result.HttpLocalizedOperationResult)3 MergePipelineConfigs (com.thoughtworks.go.config.merge.MergePipelineConfigs)2 BasicEnvironmentConfig (com.thoughtworks.go.config.BasicEnvironmentConfig)1 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)1 MaterialConfigs (com.thoughtworks.go.config.materials.MaterialConfigs)1 SvnMaterialConfig (com.thoughtworks.go.config.materials.svn.SvnMaterialConfig)1 MergeConfigOrigin (com.thoughtworks.go.config.merge.MergeConfigOrigin)1