use of com.thoughtworks.go.config.materials.mercurial.HgMaterialConfig in project gocd by gocd.
the class MaterialConfigsTest method shouldNotFailIfAllScmMaterialsInAPipelineHaveDifferentFolders.
@Test
public void shouldNotFailIfAllScmMaterialsInAPipelineHaveDifferentFolders() {
HgMaterialConfig materialOne = new HgMaterialConfig("http://url1", null);
materialOne.setConfigAttributes(Collections.singletonMap(ScmMaterialConfig.FOLDER, "folder1"));
HgMaterialConfig materialTwo = new HgMaterialConfig("http://url2", null);
materialTwo.setConfigAttributes(Collections.singletonMap(ScmMaterialConfig.FOLDER, "folder2"));
CruiseConfig config = GoConfigMother.configWithPipelines("one");
PipelineConfig pipelineOne = config.pipelineConfigByName(new CaseInsensitiveString("one"));
pipelineOne.setMaterialConfigs(new MaterialConfigs(materialOne, materialTwo));
pipelineOne.materialConfigs().validate(ConfigSaveValidationContext.forChain(config));
assertThat(pipelineOne.materialConfigs().get(0).errors().isEmpty(), is(true));
assertThat(pipelineOne.materialConfigs().get(1).errors().isEmpty(), is(true));
}
use of com.thoughtworks.go.config.materials.mercurial.HgMaterialConfig in project gocd by gocd.
the class MaterialExpansionServiceTest method shouldExpandMaterialConfigsForScheduling.
@Test
public void shouldExpandMaterialConfigsForScheduling() {
PipelineConfig pipelineConfig = new PipelineConfig();
HgMaterialConfig hg = MaterialConfigsMother.hgMaterialConfig();
pipelineConfig.addMaterialConfig(hg);
MaterialConfigs materialConfigs = materialExpansionService.expandMaterialConfigsForScheduling(pipelineConfig.materialConfigs());
assertThat(materialConfigs.size(), is(1));
assertThat(materialConfigs.get(0), is(hg));
}
use of com.thoughtworks.go.config.materials.mercurial.HgMaterialConfig in project gocd by gocd.
the class ModificationsTest method shouldIgnoreModificationsIfWildcardBlacklist.
@Test
public void shouldIgnoreModificationsIfWildcardBlacklist() {
HgMaterialConfig materialConfig = MaterialConfigsMother.hgMaterialConfig();
Filter filter = new Filter(Arrays.asList(new IgnoredFiles("**/*")));
materialConfig.setFilter(filter);
Modifications modifications = new Modifications(multipleCheckin(aCheckIn("100", "a.doc", "a.pdf", "a.java")));
assertThat(modifications.shouldBeIgnoredByFilterIn(materialConfig), is(true));
}
use of com.thoughtworks.go.config.materials.mercurial.HgMaterialConfig in project gocd by gocd.
the class ModificationsTest method shouldIncludeModificationsIfInvertFilterAndWildcardBlacklist.
@Test
public void shouldIncludeModificationsIfInvertFilterAndWildcardBlacklist() {
HgMaterialConfig materialConfig = MaterialConfigsMother.hgMaterialConfig();
Filter filter = new Filter(Arrays.asList(new IgnoredFiles("**/*")));
materialConfig.setFilter(filter);
materialConfig.setInvertFilter(true);
Modifications modifications = new Modifications(multipleCheckin(aCheckIn("100", "a.doc", "a.pdf", "a.java")));
assertThat(modifications.shouldBeIgnoredByFilterIn(materialConfig), is(false));
}
use of com.thoughtworks.go.config.materials.mercurial.HgMaterialConfig in project gocd by gocd.
the class ModificationsTest method shouldIncludeModificationsIfAnyFileIsNotIgnored.
@Test
public void shouldIncludeModificationsIfAnyFileIsNotIgnored() {
HgMaterialConfig materialConfig = MaterialConfigsMother.hgMaterialConfig();
Filter filter = new Filter(Arrays.asList(new IgnoredFiles("*.doc"), new IgnoredFiles("*.pdf")));
materialConfig.setFilter(filter);
Modifications modifications = new Modifications(multipleCheckin(aCheckIn("100", "a.doc", "a.pdf", "a.java")));
assertThat(modifications.shouldBeIgnoredByFilterIn(materialConfig), is(false));
}
Aggregations