Search in sources :

Example 1 with SvnMaterialConfig

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());
}
Also used : SvnTestRepo(com.thoughtworks.go.helper.SvnTestRepo) SvnCommand(com.thoughtworks.go.domain.materials.svn.SvnCommand) GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper) HgTestRepo(com.thoughtworks.go.helper.HgTestRepo) SvnMaterialConfig(com.thoughtworks.go.config.materials.svn.SvnMaterialConfig) Before(org.junit.Before)

Example 2 with SvnMaterialConfig

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);
}
Also used : SvnMaterialConfig(com.thoughtworks.go.config.materials.svn.SvnMaterialConfig) Pipeline(com.thoughtworks.go.domain.Pipeline)

Example 3 with SvnMaterialConfig

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));
}
Also used : MaterialConfigs(com.thoughtworks.go.config.materials.MaterialConfigs) PackageMaterialConfig(com.thoughtworks.go.config.materials.PackageMaterialConfig) SvnMaterialConfig(com.thoughtworks.go.config.materials.svn.SvnMaterialConfig) Test(org.junit.Test)

Example 4 with SvnMaterialConfig

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));
}
Also used : MaterialConfigs(com.thoughtworks.go.config.materials.MaterialConfigs) SvnMaterialConfig(com.thoughtworks.go.config.materials.svn.SvnMaterialConfig) PluggableSCMMaterialConfig(com.thoughtworks.go.config.materials.PluggableSCMMaterialConfig) Test(org.junit.Test)

Example 5 with SvnMaterialConfig

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)");
}
Also used : MaterialConfigs(com.thoughtworks.go.config.materials.MaterialConfigs) SvnMaterialConfig(com.thoughtworks.go.config.materials.svn.SvnMaterialConfig) GoConfigMother(com.thoughtworks.go.helper.GoConfigMother) Test(org.junit.jupiter.api.Test)

Aggregations

SvnMaterialConfig (com.thoughtworks.go.config.materials.svn.SvnMaterialConfig)92 Test (org.junit.jupiter.api.Test)60 MaterialConfigs (com.thoughtworks.go.config.materials.MaterialConfigs)25 P4MaterialConfig (com.thoughtworks.go.config.materials.perforce.P4MaterialConfig)15 GitMaterialConfig (com.thoughtworks.go.config.materials.git.GitMaterialConfig)12 DependencyMaterialConfig (com.thoughtworks.go.config.materials.dependency.DependencyMaterialConfig)11 HgMaterialConfig (com.thoughtworks.go.config.materials.mercurial.HgMaterialConfig)11 GoCipher (com.thoughtworks.go.security.GoCipher)11 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)9 PluggableSCMMaterialConfig (com.thoughtworks.go.config.materials.PluggableSCMMaterialConfig)9 TfsMaterialConfig (com.thoughtworks.go.config.materials.tfs.TfsMaterialConfig)8 Test (org.junit.Test)8 PipelineConfig (com.thoughtworks.go.config.PipelineConfig)7 PackageMaterialConfig (com.thoughtworks.go.config.materials.PackageMaterialConfig)6 MaterialConfig (com.thoughtworks.go.domain.materials.MaterialConfig)5 SvnMaterial (com.thoughtworks.go.config.materials.svn.SvnMaterial)4 SvnCommand (com.thoughtworks.go.domain.materials.svn.SvnCommand)4 SCMs (com.thoughtworks.go.domain.scm.SCMs)3 GoConfigMother (com.thoughtworks.go.helper.GoConfigMother)3 SvnTestRepo (com.thoughtworks.go.helper.SvnTestRepo)3