use of com.thoughtworks.go.config.materials.mercurial.HgMaterialConfig in project gocd by gocd.
the class ModificationsTest method shouldIgnoreModificationsIfInvertFilterAndSpecificFileNotChanged.
@Test
public void shouldIgnoreModificationsIfInvertFilterAndSpecificFileNotChanged() {
HgMaterialConfig materialConfig = MaterialConfigsMother.hgMaterialConfig();
Filter filter = new Filter(Arrays.asList(new IgnoredFiles("*.foo")));
materialConfig.setFilter(filter);
materialConfig.setInvertFilter(true);
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 shouldIgnoreModificationsIfInvertFilterAndEmptyIgnoreList.
@Test
public void shouldIgnoreModificationsIfInvertFilterAndEmptyIgnoreList() {
HgMaterialConfig materialConfig = MaterialConfigsMother.hgMaterialConfig();
Filter filter = new Filter();
materialConfig.setFilter(filter);
materialConfig.setInvertFilter(true);
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 shouldIncludeModificationsIfAnyFileIsNotIgnored1.
@Test
public void shouldIncludeModificationsIfAnyFileIsNotIgnored1() {
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"), aCheckIn("100", "a.java")));
assertThat(modifications.shouldBeIgnoredByFilterIn(materialConfig), is(false));
}
use of com.thoughtworks.go.config.materials.mercurial.HgMaterialConfig in project gocd by gocd.
the class GoConfigMaterialsTest method pipelineWithManyMaterials.
private PipelineConfig pipelineWithManyMaterials(boolean autoUpdate) {
SvnMaterialConfig svnMaterialConfig = MaterialConfigsMother.svnMaterialConfig();
svnMaterialConfig.setAutoUpdate(autoUpdate);
MaterialConfig gitMaterialConfig = MaterialConfigsMother.gitMaterialConfig("/foo/bar.git");
HgMaterialConfig hgMaterialConfig = MaterialConfigsMother.hgMaterialConfig();
P4MaterialConfig p4MaterialConfig = MaterialConfigsMother.p4MaterialConfig();
return new PipelineConfig(new CaseInsensitiveString("pipeline1"), new MaterialConfigs(svnMaterialConfig, hgMaterialConfig, gitMaterialConfig, p4MaterialConfig));
}
use of com.thoughtworks.go.config.materials.mercurial.HgMaterialConfig in project gocd by gocd.
the class GoConfigMaterialsTest method getStagesUsedAsMaterials.
@Test
public void getStagesUsedAsMaterials() {
HgMaterialConfig hg = MaterialConfigsMother.hgMaterialConfig();
StageConfig upStage = new StageConfig(new CaseInsensitiveString("stage1"), new JobConfigs());
PipelineConfig up1 = new PipelineConfig(new CaseInsensitiveString("up1"), new MaterialConfigs(hg), upStage);
PipelineConfig up2 = new PipelineConfig(new CaseInsensitiveString("up2"), new MaterialConfigs(hg), new StageConfig(new CaseInsensitiveString("stage2"), new JobConfigs()));
DependencyMaterialConfig dependency1 = MaterialConfigsMother.dependencyMaterialConfig("up1", "stage1");
DependencyMaterialConfig dependency2 = MaterialConfigsMother.dependencyMaterialConfig("up2", "stage2");
PipelineConfig down1 = new PipelineConfig(new CaseInsensitiveString("down1"), new MaterialConfigs(dependency1, dependency2, hg));
PipelineConfig down2 = new PipelineConfig(new CaseInsensitiveString("down2"), new MaterialConfigs(dependency1, dependency2, hg));
CruiseConfig config = new BasicCruiseConfig(new BasicPipelineConfigs(up1, up2, down1, down2));
Set<StageConfig> stages = config.getStagesUsedAsMaterials(up1);
assertThat(stages.size(), is(1));
assertThat(stages.contains(upStage), is(true));
}
Aggregations