use of com.thoughtworks.go.config.materials.svn.SvnMaterialConfig in project gocd by gocd.
the class BuildCauseProducerServiceWithFlipModificationTest method setup.
@Before
public void setup() throws Exception {
configHelper = new GoConfigFileHelper();
dbHelper.onSetUp();
configHelper.onSetUp();
configHelper.usingCruiseConfigDao(goConfigDao).initializeConfigFile();
svnRepository = new SvnTestRepo(temporaryFolder);
hgTestRepo = new HgTestRepo("testHgRepo", temporaryFolder);
repository = new SvnCommand(null, svnRepository.projectRepositoryUrl());
svnMaterialConfig = new SvnMaterialConfig(repository.getUrl().forCommandline(), repository.getUserName(), repository.getPassword(), repository.isCheckExternals());
}
use of com.thoughtworks.go.config.materials.svn.SvnMaterialConfig in project gocd by gocd.
the class BackupServiceH2IntegrationTest method saveAPipeline.
private Pipeline saveAPipeline() {
PipelineConfig pipelineConfig = PipelineConfigMother.pipelineConfig("pipeline", new StageConfig(new CaseInsensitiveString("stage"), new JobConfigs(new JobConfig("job-one"))));
pipelineConfig.materialConfigs().clear();
SvnMaterialConfig onDirOne = MaterialConfigsMother.svnMaterialConfig("google.com", "dirOne", "loser", "boozer", false, "**/*.html");
pipelineConfig.addMaterialConfig(onDirOne);
Pipeline building = PipelineMother.building(pipelineConfig);
return dbHelper.savePipelineWithMaterials(building);
}
use of com.thoughtworks.go.config.materials.svn.SvnMaterialConfig in project gocd by gocd.
the class PipelineConfigTest method shouldGetPackageMaterialConfigs.
@Test
public void shouldGetPackageMaterialConfigs() throws Exception {
SvnMaterialConfig svn = new SvnMaterialConfig("svn", false);
PackageMaterialConfig packageMaterialOne = new PackageMaterialConfig();
PackageMaterialConfig packageMaterialTwo = new PackageMaterialConfig();
PipelineConfig pipelineConfig = PipelineConfigMother.pipelineConfig("p1", new MaterialConfigs(svn, packageMaterialOne, packageMaterialTwo));
List<PackageMaterialConfig> packageMaterialConfigs = pipelineConfig.packageMaterialConfigs();
assertThat(packageMaterialConfigs.size(), is(2));
assertThat(packageMaterialConfigs, hasItems(packageMaterialOne, packageMaterialTwo));
}
use of com.thoughtworks.go.config.materials.svn.SvnMaterialConfig in project gocd by gocd.
the class PipelineConfigTest method shouldGetPluggableSCMMaterialConfigs.
@Test
public void shouldGetPluggableSCMMaterialConfigs() throws Exception {
SvnMaterialConfig svn = new SvnMaterialConfig("svn", false);
PluggableSCMMaterialConfig pluggableSCMMaterialOne = new PluggableSCMMaterialConfig("scm-id-1");
PluggableSCMMaterialConfig pluggableSCMMaterialTwo = new PluggableSCMMaterialConfig("scm-id-2");
PipelineConfig pipelineConfig = PipelineConfigMother.pipelineConfig("p1", new MaterialConfigs(svn, pluggableSCMMaterialOne, pluggableSCMMaterialTwo));
List<PluggableSCMMaterialConfig> pluggableSCMMaterialConfigs = pipelineConfig.pluggableSCMMaterialConfigs();
assertThat(pluggableSCMMaterialConfigs.size(), is(2));
assertThat(pluggableSCMMaterialConfigs, hasItems(pluggableSCMMaterialOne, pluggableSCMMaterialTwo));
}
use of com.thoughtworks.go.config.materials.svn.SvnMaterialConfig in project gocd by gocd.
the class ConfigRepoConfigTest method validate_shouldNotAllowPipelineWithSameRepositoryAndDifferentAutoUpdate.
@Test
public void validate_shouldNotAllowPipelineWithSameRepositoryAndDifferentAutoUpdate() {
CruiseConfig cruiseConfig = new BasicCruiseConfig();
GoConfigMother mother = new GoConfigMother();
MaterialConfigs materialConfigs = new MaterialConfigs();
SvnMaterialConfig svnInConfigRepo = svn("url", false);
SvnMaterialConfig svnInPipelineConfig = svn("url", false);
svnInConfigRepo.setAutoUpdate(false);
svnInPipelineConfig.setAutoUpdate(true);
materialConfigs.add(svnInPipelineConfig);
ConfigRepoConfig configRepoConfig = ConfigRepoConfig.createConfigRepoConfig(svnInConfigRepo, "plug", "id");
cruiseConfig.setConfigRepos(new ConfigReposConfig(configRepoConfig));
PipelineConfig pipeline1 = mother.addPipeline(cruiseConfig, "badpipe", "build", materialConfigs, "build");
configRepoConfig.validate(ConfigSaveValidationContext.forChain(cruiseConfig, new BasicPipelineConfigs(), pipeline1));
assertThat(svnInConfigRepo.errors().isEmpty()).isFalse();
assertThat(svnInConfigRepo.errors().on("autoUpdate")).isEqualTo("The material of type Subversion (url) is used elsewhere with a different value for autoUpdate (\"Poll for changes\"). All copies of this material must have the same autoUpdate setting or configuration repository must be removed.\n Config Repository: id (auto update disabled).\n Pipelines: badpipe (auto update enabled)");
}
Aggregations