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));
}
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));
}
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));
}
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));
}
Aggregations