use of com.thoughtworks.go.config.materials.mercurial.HgMaterial in project gocd by gocd.
the class MaterialsTest method shouldNotGetPackageMaterialWhenOneOtherScmMaterialWithNoFolder.
@Test
public void shouldNotGetPackageMaterialWhenOneOtherScmMaterialWithNoFolder() {
Materials materials = new Materials();
Material material1 = new PackageMaterial("pid");
Material material2 = new HgMaterial("", null);
materials.add(material1);
materials.add(material2);
assertThat(materials.byFolder(null), is(material2));
}
use of com.thoughtworks.go.config.materials.mercurial.HgMaterial in project gocd by gocd.
the class MaterialsTest method shouldReturnExistingHgMaterialFromMaterialsIfItContainsOne.
@Test
public void shouldReturnExistingHgMaterialFromMaterialsIfItContainsOne() {
Materials materials = new Materials();
HgMaterial existingMaterial = new HgMaterial("foo", null);
materials.add(existingMaterial);
assertThat(materials.getHgMaterial(), is(sameInstance(existingMaterial)));
}
use of com.thoughtworks.go.config.materials.mercurial.HgMaterial in project gocd by gocd.
the class MaterialsTest method shouldReturnMaterialMatchingTheGivenMaterial.
@Test
public void shouldReturnMaterialMatchingTheGivenMaterial() {
Materials materials = new Materials();
HgMaterial material1 = MaterialsMother.hgMaterial();
material1.setFilter(new Filter(new IgnoredFiles("patter")));
SvnMaterial material2 = MaterialsMother.svnMaterial();
materials.add(material1);
materials.add(material2);
assertThat(materials.get(MaterialsMother.hgMaterial()), is(material1));
try {
materials.get(MaterialsMother.p4Material());
fail("Must not have found the p4 material");
} catch (Exception expected) {
}
}
use of com.thoughtworks.go.config.materials.mercurial.HgMaterial in project gocd by gocd.
the class MaterialsMother method filteredHgMaterial.
public static Material filteredHgMaterial(String pattern) {
HgMaterial material = hgMaterial();
material.setFilter(new Filter(new IgnoredFiles(pattern)));
return material;
}
use of com.thoughtworks.go.config.materials.mercurial.HgMaterial in project gocd by gocd.
the class MaterialsMother method hgMaterial.
public static HgMaterial hgMaterial(String url, String folder) {
final HgMaterial material = new HgMaterial(url, folder);
material.setAutoUpdate(true);
return material;
}
Aggregations