Search in sources :

Example 81 with MaterialConfigs

use of com.thoughtworks.go.config.materials.MaterialConfigs in project gocd by gocd.

the class ModificationBuildCauseTest method shouldBeInvalidWhenMaterialsFromConfigAreNotInBuildCause.

@Test
public void shouldBeInvalidWhenMaterialsFromConfigAreNotInBuildCause() {
    SvnMaterial mainRepo = MaterialsMother.svnMaterial("mainRepo");
    SvnMaterial extRepo = MaterialsMother.svnMaterial("externalRepo");
    MaterialRevisions revisions = new MaterialRevisions();
    revisions.addRevision(mainRepo, multipleModificationList());
    buildCause = BuildCause.createWithModifications(revisions, "");
    try {
        buildCause.assertMaterialsMatch(new MaterialConfigs(mainRepo.config(), extRepo.config()));
        fail("All the materials from config file should be in build cause");
    } catch (Exception expected) {
    }
}
Also used : MaterialConfigs(com.thoughtworks.go.config.materials.MaterialConfigs) SvnMaterial(com.thoughtworks.go.config.materials.svn.SvnMaterial) Test(org.junit.Test)

Example 82 with MaterialConfigs

use of com.thoughtworks.go.config.materials.MaterialConfigs in project gocd by gocd.

the class ModificationBuildCauseTest method shouldBeValidWithExternalMaterials.

@Test
public void shouldBeValidWithExternalMaterials() {
    SvnMaterial mainRepo = MaterialsMother.svnMaterial("mainRepo");
    MaterialRevisions revisions = new MaterialRevisions();
    revisions.addRevision(mainRepo, multipleModificationList());
    revisions.addRevision(MaterialsMother.svnMaterial("externalRepo"), multipleModificationList());
    buildCause = BuildCause.createWithModifications(revisions, "");
    buildCause.assertMaterialsMatch(new MaterialConfigs(mainRepo.config()));
}
Also used : MaterialConfigs(com.thoughtworks.go.config.materials.MaterialConfigs) SvnMaterial(com.thoughtworks.go.config.materials.svn.SvnMaterial) Test(org.junit.Test)

Example 83 with MaterialConfigs

use of com.thoughtworks.go.config.materials.MaterialConfigs 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 84 with MaterialConfigs

use of com.thoughtworks.go.config.materials.MaterialConfigs 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 85 with MaterialConfigs

use of com.thoughtworks.go.config.materials.MaterialConfigs in project gocd by gocd.

the class PipelineConfigTest method shouldSupportSpecialCharacters.

@Test
public void shouldSupportSpecialCharacters() {
    PipelineConfig pipelineConfig = new PipelineConfig(new CaseInsensitiveString("cruise"), new MaterialConfigs());
    pipelineConfig.setLabelTemplate("pipeline-${COUN_T}-${my-material}${h.i}${**}");
    Set<String> variables = pipelineConfig.getTemplateVariables();
    assertThat(variables, contains("COUN_T", "my-material", "h.i", "**"));
}
Also used : MaterialConfigs(com.thoughtworks.go.config.materials.MaterialConfigs) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) Test(org.junit.Test)

Aggregations

MaterialConfigs (com.thoughtworks.go.config.materials.MaterialConfigs)218 Test (org.junit.Test)158 DependencyMaterialConfig (com.thoughtworks.go.config.materials.dependency.DependencyMaterialConfig)35 MaterialConfig (com.thoughtworks.go.domain.materials.MaterialConfig)33 PipelineConfig (com.thoughtworks.go.config.PipelineConfig)32 BuildCause (com.thoughtworks.go.domain.buildcause.BuildCause)32 HgMaterial (com.thoughtworks.go.config.materials.mercurial.HgMaterial)27 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)25 GitMaterialConfig (com.thoughtworks.go.config.materials.git.GitMaterialConfig)25 SvnMaterialConfig (com.thoughtworks.go.config.materials.svn.SvnMaterialConfig)25 TimeProvider (com.thoughtworks.go.util.TimeProvider)25 GitMaterial (com.thoughtworks.go.config.materials.git.GitMaterial)21 DependencyMaterial (com.thoughtworks.go.config.materials.dependency.DependencyMaterial)19 SvnMaterial (com.thoughtworks.go.config.materials.svn.SvnMaterial)19 ValueStreamMapPresentationModel (com.thoughtworks.go.server.presentation.models.ValueStreamMapPresentationModel)16 PackageMaterialConfig (com.thoughtworks.go.config.materials.PackageMaterialConfig)15 HgMaterialConfig (com.thoughtworks.go.config.materials.mercurial.HgMaterialConfig)14 MaterialRevisions (com.thoughtworks.go.domain.MaterialRevisions)14 Material (com.thoughtworks.go.domain.materials.Material)14 Materials (com.thoughtworks.go.config.materials.Materials)12