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) {
}
}
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()));
}
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));
}
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));
}
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", "**"));
}
Aggregations