Search in sources :

Example 6 with TfsMaterial

use of com.thoughtworks.go.config.materials.tfs.TfsMaterial in project gocd by gocd.

the class PipelineMother method pipelineWithAllTypesOfMaterials.

public static Pipeline pipelineWithAllTypesOfMaterials(String pipelineName, String stageName, String jobName, String fixedMaterialRevisionForAllMaterials) {
    GitMaterial gitMaterial = MaterialsMother.gitMaterial("http://user:password@gitrepo.com", null, "branch");
    HgMaterial hgMaterial = MaterialsMother.hgMaterial("http://user:password@hgrepo.com");
    SvnMaterial svnMaterial = MaterialsMother.svnMaterial("http://user:password@svnrepo.com", null, "username", "password", false, null);
    TfsMaterial tfsMaterial = MaterialsMother.tfsMaterial("http://user:password@tfsrepo.com");
    P4Material p4Material = MaterialsMother.p4Material("127.0.0.1:1666", "username", "password", "view", false);
    DependencyMaterial dependencyMaterial = MaterialsMother.dependencyMaterial();
    PackageMaterial packageMaterial = MaterialsMother.packageMaterial();
    PluggableSCMMaterial pluggableSCMMaterial = MaterialsMother.pluggableSCMMaterial();
    Materials materials = new Materials(gitMaterial, hgMaterial, svnMaterial, tfsMaterial, p4Material, dependencyMaterial, packageMaterial, pluggableSCMMaterial);
    return new Pipeline(pipelineName, BuildCause.createWithModifications(ModificationsMother.modifyOneFile(materials, fixedMaterialRevisionForAllMaterials), ""), StageMother.passedStageInstance(stageName, jobName, pipelineName));
}
Also used : TfsMaterial(com.thoughtworks.go.config.materials.tfs.TfsMaterial) PluggableSCMMaterial(com.thoughtworks.go.config.materials.PluggableSCMMaterial) GitMaterial(com.thoughtworks.go.config.materials.git.GitMaterial) PackageMaterial(com.thoughtworks.go.config.materials.PackageMaterial) SvnMaterial(com.thoughtworks.go.config.materials.svn.SvnMaterial) Materials(com.thoughtworks.go.config.materials.Materials) HgMaterial(com.thoughtworks.go.config.materials.mercurial.HgMaterial) DependencyMaterial(com.thoughtworks.go.config.materials.dependency.DependencyMaterial) P4Material(com.thoughtworks.go.config.materials.perforce.P4Material)

Example 7 with TfsMaterial

use of com.thoughtworks.go.config.materials.tfs.TfsMaterial in project gocd by gocd.

the class TfsMaterialPersistenceTest method shouldBeAbleToConvertAMaterialInstanceObjectToTfsMaterialObject.

@Test
public void shouldBeAbleToConvertAMaterialInstanceObjectToTfsMaterialObject() {
    TfsMaterial tfsCfg = new TfsMaterial(new UrlArgument("url"), "loser", "CORPORATE", "password", "/dev/null");
    tfsCfg.setFolder("folder");
    tfsCfg.setName(new CaseInsensitiveString("materialName"));
    MaterialInstance tfsInstance = materialRepository.findOrCreateFrom(tfsCfg);
    Material material = tfsInstance.toOldMaterial("materialName", "folder", "password");
    assertThat(material, is(tfsCfg));
}
Also used : UrlArgument(com.thoughtworks.go.util.command.UrlArgument) TfsMaterial(com.thoughtworks.go.config.materials.tfs.TfsMaterial) Material(com.thoughtworks.go.domain.materials.Material) TfsMaterial(com.thoughtworks.go.config.materials.tfs.TfsMaterial) MaterialInstance(com.thoughtworks.go.domain.MaterialInstance) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString) Test(org.junit.jupiter.api.Test)

Example 8 with TfsMaterial

use of com.thoughtworks.go.config.materials.tfs.TfsMaterial in project gocd by gocd.

the class TfsMaterialPersistenceTest method shouldSaveMaterialInstance.

@Test
public void shouldSaveMaterialInstance() throws Exception {
    TfsMaterial tfsCfg = new TfsMaterial(new UrlArgument("url"), "loser", "CORPORATE", "foo_bar_baz", "/dev/null");
    MaterialInstance materialInstance = materialRepository.findOrCreateFrom(tfsCfg);
    assertThat(materialRepository.findMaterialInstance(tfsCfg), is(materialInstance));
}
Also used : UrlArgument(com.thoughtworks.go.util.command.UrlArgument) TfsMaterial(com.thoughtworks.go.config.materials.tfs.TfsMaterial) MaterialInstance(com.thoughtworks.go.domain.MaterialInstance) Test(org.junit.jupiter.api.Test)

Example 9 with TfsMaterial

use of com.thoughtworks.go.config.materials.tfs.TfsMaterial in project gocd by gocd.

the class TfsMaterialPersistenceTest method shouldFindOldMaterial.

@Test
public void shouldFindOldMaterial() {
    TfsMaterial tfsCfg = new TfsMaterial(new UrlArgument("url"), "loser", "CORPORATE", "foo_bar_baz", "/dev/null");
    MaterialInstance tfsInstance1 = materialRepository.findOrCreateFrom(tfsCfg);
    goCache.clear();
    MaterialInstance tfsInstance2 = materialRepository.findOrCreateFrom(tfsCfg);
    assertThat(tfsInstance1, is(tfsInstance2));
}
Also used : UrlArgument(com.thoughtworks.go.util.command.UrlArgument) TfsMaterial(com.thoughtworks.go.config.materials.tfs.TfsMaterial) MaterialInstance(com.thoughtworks.go.domain.MaterialInstance) Test(org.junit.jupiter.api.Test)

Aggregations

TfsMaterial (com.thoughtworks.go.config.materials.tfs.TfsMaterial)9 Test (org.junit.jupiter.api.Test)5 DependencyMaterial (com.thoughtworks.go.config.materials.dependency.DependencyMaterial)4 GitMaterial (com.thoughtworks.go.config.materials.git.GitMaterial)4 HgMaterial (com.thoughtworks.go.config.materials.mercurial.HgMaterial)4 P4Material (com.thoughtworks.go.config.materials.perforce.P4Material)4 SvnMaterial (com.thoughtworks.go.config.materials.svn.SvnMaterial)4 UrlArgument (com.thoughtworks.go.util.command.UrlArgument)4 MaterialInstance (com.thoughtworks.go.domain.MaterialInstance)3 PackageMaterial (com.thoughtworks.go.config.materials.PackageMaterial)2 Material (com.thoughtworks.go.domain.materials.Material)2 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)1 Materials (com.thoughtworks.go.config.materials.Materials)1 PluggableSCMMaterial (com.thoughtworks.go.config.materials.PluggableSCMMaterial)1 ScmMaterial (com.thoughtworks.go.config.materials.ScmMaterial)1 MaterialRevisions (com.thoughtworks.go.domain.MaterialRevisions)1 DependencyMaterialRevision (com.thoughtworks.go.domain.materials.dependency.DependencyMaterialRevision)1 GitMaterialUpdater (com.thoughtworks.go.domain.materials.git.GitMaterialUpdater)1 HgMaterialInstance (com.thoughtworks.go.domain.materials.mercurial.HgMaterialInstance)1 HgMaterialUpdater (com.thoughtworks.go.domain.materials.mercurial.HgMaterialUpdater)1