Search in sources :

Example 61 with UrlArgument

use of com.thoughtworks.go.util.command.UrlArgument in project gocd by gocd.

the class TfsMaterialPersistenceTest method shouldBeAbleToConvertAMaterialInstanceObjectToTfsMaterialObject.

@Test
public void shouldBeAbleToConvertAMaterialInstanceObjectToTfsMaterialObject() {
    TfsMaterial tfsCfg = new TfsMaterial(new GoCipher(), 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) GoCipher(com.thoughtworks.go.security.GoCipher) 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.Test)

Example 62 with UrlArgument

use of com.thoughtworks.go.util.command.UrlArgument in project gocd by gocd.

the class TfsMaterialPersistenceTest method shouldFindOldMaterial.

@Test
public void shouldFindOldMaterial() {
    TfsMaterial tfsCfg = new TfsMaterial(new GoCipher(), 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) GoCipher(com.thoughtworks.go.security.GoCipher) MaterialInstance(com.thoughtworks.go.domain.MaterialInstance) Test(org.junit.Test)

Example 63 with UrlArgument

use of com.thoughtworks.go.util.command.UrlArgument in project gocd by gocd.

the class TfsMaterialPersistenceTest method shouldSaveMaterialInstance.

@Test
public void shouldSaveMaterialInstance() throws Exception {
    TfsMaterial tfsCfg = new TfsMaterial(new GoCipher(), 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) GoCipher(com.thoughtworks.go.security.GoCipher) MaterialInstance(com.thoughtworks.go.domain.MaterialInstance) Test(org.junit.Test)

Aggregations

UrlArgument (com.thoughtworks.go.util.command.UrlArgument)63 Test (org.junit.Test)47 GoCipher (com.thoughtworks.go.security.GoCipher)37 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)9 ConfigSaveValidationContext (com.thoughtworks.go.config.ConfigSaveValidationContext)7 TfsMaterialConfig (com.thoughtworks.go.config.materials.tfs.TfsMaterialConfig)7 GitMaterialConfig (com.thoughtworks.go.config.materials.git.GitMaterialConfig)5 SvnMaterialConfig (com.thoughtworks.go.config.materials.svn.SvnMaterialConfig)5 Material (com.thoughtworks.go.domain.materials.Material)5 HgUrlArgument (com.thoughtworks.go.util.command.HgUrlArgument)5 File (java.io.File)5 Map (java.util.Map)5 GitMaterial (com.thoughtworks.go.config.materials.git.GitMaterial)4 HgMaterialConfig (com.thoughtworks.go.config.materials.mercurial.HgMaterialConfig)4 P4MaterialConfig (com.thoughtworks.go.config.materials.perforce.P4MaterialConfig)4 SvnMaterial (com.thoughtworks.go.config.materials.svn.SvnMaterial)4 TfsMaterial (com.thoughtworks.go.config.materials.tfs.TfsMaterial)4 InvalidCipherTextException (org.bouncycastle.crypto.InvalidCipherTextException)4 MaterialConfigs (com.thoughtworks.go.config.materials.MaterialConfigs)3 PackageMaterialConfig (com.thoughtworks.go.config.materials.PackageMaterialConfig)3