use of com.thoughtworks.go.config.remote.FileConfigOrigin in project gocd by gocd.
the class PipelineGroupsTest method shouldGetLocalPartsWhenOriginIsFile.
@Test
public void shouldGetLocalPartsWhenOriginIsFile() {
PipelineConfigs defaultGroup = createGroup("defaultGroup", createPipelineConfig("pipeline1", "stage1"));
defaultGroup.setOrigins(new FileConfigOrigin());
PipelineGroups groups = new PipelineGroups(defaultGroup);
assertThat(groups.getLocal().size(), is(1));
assertThat(groups.getLocal().get(0), is(defaultGroup));
}
use of com.thoughtworks.go.config.remote.FileConfigOrigin in project gocd by gocd.
the class EnvironmentsConfigTest method shouldGetLocalPartsWhenOriginIsMixed.
@Test
public void shouldGetLocalPartsWhenOriginIsMixed() {
env.setOrigins(new FileConfigOrigin());
BasicEnvironmentConfig prodLocalPart = new BasicEnvironmentConfig(new CaseInsensitiveString("PROD"));
prodLocalPart.addAgent("1235");
prodLocalPart.setOrigins(new FileConfigOrigin());
BasicEnvironmentConfig prodRemotePart = new BasicEnvironmentConfig(new CaseInsensitiveString("PROD"));
prodRemotePart.setOrigins(new RepoConfigOrigin());
MergeEnvironmentConfig pairEnvironmentConfig = new MergeEnvironmentConfig(prodLocalPart, prodRemotePart);
configs.add(pairEnvironmentConfig);
assertThat(configs.getLocal().size(), is(2));
assertThat(configs.getLocal(), hasItem(env));
assertThat(configs.getLocal(), hasItem(prodLocalPart));
}
use of com.thoughtworks.go.config.remote.FileConfigOrigin in project gocd by gocd.
the class EnvironmentsConfigTest method shouldGetLocalPartsWhenOriginIsFile.
@Test
public void shouldGetLocalPartsWhenOriginIsFile() {
env.setOrigins(new FileConfigOrigin());
assertThat(configs.getLocal().size(), is(1));
assertThat(configs.getLocal().get(0), Is.<EnvironmentConfig>is(env));
}
use of com.thoughtworks.go.config.remote.FileConfigOrigin in project gocd by gocd.
the class MagicalGoConfigXmlLoaderTest method shouldSetConfigOriginInEnvironment_AfterLoadingConfigFile.
@Test
public void shouldSetConfigOriginInEnvironment_AfterLoadingConfigFile() {
String content = ConfigFileFixture.configWithEnvironments("<environments>" + " <environment name='uat'>" + " <agents>" + " <physical uuid='1'/>" + " <physical uuid='2'/>" + " </agents>" + " </environment>" + "</environments>");
EnvironmentsConfig environmentsConfig = ConfigMigrator.loadWithMigration(content).config.getEnvironments();
EnvironmentConfig uat = environmentsConfig.get(0);
assertThat(uat.getOrigin(), Is.<ConfigOrigin>is(new FileConfigOrigin()));
}
use of com.thoughtworks.go.config.remote.FileConfigOrigin in project gocd by gocd.
the class GoConfigMother method addPipeline.
public PipelineConfig addPipeline(CruiseConfig cruiseConfig, String pipelineName, String stageName, MaterialConfigs materialConfigs, String... buildNames) {
StageConfig stageConfig = StageConfigMother.custom(stageName, defaultBuildPlans(buildNames));
PipelineConfig pipelineConfig = new PipelineConfig(new CaseInsensitiveString(pipelineName), materialConfigs, stageConfig);
pipelineConfig.setOrigin(new FileConfigOrigin());
cruiseConfig.addPipeline(DEFAULT_GROUP, pipelineConfig);
return pipelineConfig;
}
Aggregations