Search in sources :

Example 91 with HgMaterial

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));
}
Also used : HgMaterial(com.thoughtworks.go.config.materials.mercurial.HgMaterial) P4Material(com.thoughtworks.go.config.materials.perforce.P4Material) DependencyMaterial(com.thoughtworks.go.config.materials.dependency.DependencyMaterial) GitMaterial(com.thoughtworks.go.config.materials.git.GitMaterial) SvnMaterial(com.thoughtworks.go.config.materials.svn.SvnMaterial) HgMaterial(com.thoughtworks.go.config.materials.mercurial.HgMaterial) Test(org.junit.Test)

Example 92 with HgMaterial

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)));
}
Also used : HgMaterial(com.thoughtworks.go.config.materials.mercurial.HgMaterial) Test(org.junit.Test)

Example 93 with HgMaterial

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) {
    }
}
Also used : SvnMaterial(com.thoughtworks.go.config.materials.svn.SvnMaterial) HgMaterial(com.thoughtworks.go.config.materials.mercurial.HgMaterial) IOException(java.io.IOException) Test(org.junit.Test)

Example 94 with HgMaterial

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;
}
Also used : HgMaterial(com.thoughtworks.go.config.materials.mercurial.HgMaterial)

Example 95 with HgMaterial

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;
}
Also used : HgMaterial(com.thoughtworks.go.config.materials.mercurial.HgMaterial)

Aggregations

HgMaterial (com.thoughtworks.go.config.materials.mercurial.HgMaterial)121 Test (org.junit.Test)107 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)34 MaterialRevisions (com.thoughtworks.go.domain.MaterialRevisions)29 MaterialConfigs (com.thoughtworks.go.config.materials.MaterialConfigs)23 SvnMaterial (com.thoughtworks.go.config.materials.svn.SvnMaterial)23 DependencyMaterial (com.thoughtworks.go.config.materials.dependency.DependencyMaterial)20 GitMaterial (com.thoughtworks.go.config.materials.git.GitMaterial)18 PipelineConfig (com.thoughtworks.go.config.PipelineConfig)16 Material (com.thoughtworks.go.domain.materials.Material)15 P4Material (com.thoughtworks.go.config.materials.perforce.P4Material)10 ServerHealthStateOperationResult (com.thoughtworks.go.server.service.result.ServerHealthStateOperationResult)10 Date (java.util.Date)10 HgMaterialConfig (com.thoughtworks.go.config.materials.mercurial.HgMaterialConfig)9 ScheduleTestUtil (com.thoughtworks.go.server.service.ScheduleTestUtil)9 TimeProvider (com.thoughtworks.go.util.TimeProvider)8 Pagination (com.thoughtworks.go.server.util.Pagination)7 MaterialRevision (com.thoughtworks.go.domain.MaterialRevision)6 Modification (com.thoughtworks.go.domain.materials.Modification)6 File (java.io.File)6