Search in sources :

Example 16 with P4MaterialConfig

use of com.thoughtworks.go.config.materials.perforce.P4MaterialConfig in project gocd by gocd.

the class ConfigConverterTest method shouldConvertP4MaterialWhenPlainPassword.

@Test
public void shouldConvertP4MaterialWhenPlainPassword() {
    CRP4Material crp4Material = CRP4Material.withPlainPassword("name", "folder", false, false, filter, "server:port", "user", "secret", true, "view");
    P4MaterialConfig p4MaterialConfig = (P4MaterialConfig) configConverter.toMaterialConfig(crp4Material, context);
    assertThat(p4MaterialConfig.getName().toLower(), is("name"));
    assertThat(p4MaterialConfig.getFolder(), is("folder"));
    assertThat(p4MaterialConfig.getAutoUpdate(), is(false));
    assertThat(p4MaterialConfig.getFilterAsString(), is("filter"));
    assertThat(p4MaterialConfig.getUrl(), is("server:port"));
    assertThat(p4MaterialConfig.getUserName(), is("user"));
    assertThat(p4MaterialConfig.getPassword(), is("secret"));
    assertThat(p4MaterialConfig.getUseTickets(), is(true));
    assertThat(p4MaterialConfig.getView(), is("view"));
}
Also used : P4MaterialConfig(com.thoughtworks.go.config.materials.perforce.P4MaterialConfig) Test(org.junit.Test)

Example 17 with P4MaterialConfig

use of com.thoughtworks.go.config.materials.perforce.P4MaterialConfig in project gocd by gocd.

the class MaterialRepositoryIntegrationTest method shouldSaveP4PipelineMaterialRevisions.

@Test
public void shouldSaveP4PipelineMaterialRevisions() throws Exception {
    P4MaterialConfig p4MaterialConfig = MaterialConfigsMother.p4MaterialConfig("serverAndPort", "user", "pwd", "view", true);
    assertCanLoadAndSaveMaterialRevisionsFor(p4MaterialConfig);
}
Also used : P4MaterialConfig(com.thoughtworks.go.config.materials.perforce.P4MaterialConfig) Test(org.junit.Test)

Example 18 with P4MaterialConfig

use of com.thoughtworks.go.config.materials.perforce.P4MaterialConfig in project gocd by gocd.

the class P4TestRepo method materialConfig.

public P4MaterialConfig materialConfig(String p4view) {
    P4MaterialConfig p4MaterialConfig = new P4MaterialConfig(serverAndPort(), p4view);
    p4MaterialConfig.setConfigAttributes(Collections.singletonMap(P4MaterialConfig.USERNAME, user));
    p4MaterialConfig.setPassword(password);
    p4MaterialConfig.setUseTickets(useTickets);
    return p4MaterialConfig;
}
Also used : P4MaterialConfig(com.thoughtworks.go.config.materials.perforce.P4MaterialConfig)

Example 19 with P4MaterialConfig

use of com.thoughtworks.go.config.materials.perforce.P4MaterialConfig in project gocd by gocd.

the class MaterialConfigsMother method p4MaterialConfigFull.

public static P4MaterialConfig p4MaterialConfigFull() {
    Filter filter = new Filter(new IgnoredFiles("**/*.html"), new IgnoredFiles("**/foobar/"));
    P4MaterialConfig config = p4MaterialConfig("host:9876", "user", "password", "view", true);
    config.setFolder("dest-folder");
    config.setFilter(filter);
    config.setName(new CaseInsensitiveString("p4-material"));
    return config;
}
Also used : P4MaterialConfig(com.thoughtworks.go.config.materials.perforce.P4MaterialConfig) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString)

Example 20 with P4MaterialConfig

use of com.thoughtworks.go.config.materials.perforce.P4MaterialConfig in project gocd by gocd.

the class CruiseConfigTestBase method shouldLoadPasswordForGivenMaterialFingerprint.

@Test
public void shouldLoadPasswordForGivenMaterialFingerprint() {
    MaterialConfig svnConfig = new SvnMaterialConfig("url", "loser", "boozer", true);
    PipelineConfig one = PipelineConfigMother.pipelineConfig("one", svnConfig, new JobConfigs(new JobConfig("job")));
    cruiseConfig.addPipeline("group-1", one);
    P4MaterialConfig p4One = new P4MaterialConfig("server_and_port", "outside_the_window");
    p4One.setPassword("abcdef");
    PipelineConfig two = PipelineConfigMother.pipelineConfig("two", p4One, new JobConfigs(new JobConfig("job")));
    cruiseConfig.addPipeline("group-2", two);
    P4MaterialConfig p4Two = new P4MaterialConfig("port_and_server", "inside_yourself");
    p4Two.setPassword("fedcba");
    PipelineConfig three = PipelineConfigMother.pipelineConfig("three", p4Two, new JobConfigs(new JobConfig("job")));
    cruiseConfig.addPipeline("group-3", three);
    assertThat(cruiseConfig.materialConfigFor(svnConfig.getFingerprint()), is(svnConfig));
    assertThat(cruiseConfig.materialConfigFor(p4One.getFingerprint()), is(p4One));
    assertThat(cruiseConfig.materialConfigFor(p4Two.getFingerprint()), is(p4Two));
    assertThat(cruiseConfig.materialConfigFor("some_crazy_fingerprint"), is(nullValue()));
}
Also used : P4MaterialConfig(com.thoughtworks.go.config.materials.perforce.P4MaterialConfig) PluggableSCMMaterialConfig(com.thoughtworks.go.config.materials.PluggableSCMMaterialConfig) GitMaterialConfig(com.thoughtworks.go.config.materials.git.GitMaterialConfig) MaterialConfig(com.thoughtworks.go.domain.materials.MaterialConfig) HgMaterialConfig(com.thoughtworks.go.config.materials.mercurial.HgMaterialConfig) P4MaterialConfig(com.thoughtworks.go.config.materials.perforce.P4MaterialConfig) TfsMaterialConfig(com.thoughtworks.go.config.materials.tfs.TfsMaterialConfig) DependencyMaterialConfig(com.thoughtworks.go.config.materials.dependency.DependencyMaterialConfig) SvnMaterialConfig(com.thoughtworks.go.config.materials.svn.SvnMaterialConfig) PackageMaterialConfig(com.thoughtworks.go.config.materials.PackageMaterialConfig) ScmMaterialConfig(com.thoughtworks.go.config.materials.ScmMaterialConfig) SvnMaterialConfig(com.thoughtworks.go.config.materials.svn.SvnMaterialConfig) Test(org.junit.Test)

Aggregations

P4MaterialConfig (com.thoughtworks.go.config.materials.perforce.P4MaterialConfig)30 Test (org.junit.Test)22 SvnMaterialConfig (com.thoughtworks.go.config.materials.svn.SvnMaterialConfig)13 GitMaterialConfig (com.thoughtworks.go.config.materials.git.GitMaterialConfig)8 HgMaterialConfig (com.thoughtworks.go.config.materials.mercurial.HgMaterialConfig)8 DependencyMaterialConfig (com.thoughtworks.go.config.materials.dependency.DependencyMaterialConfig)7 TfsMaterialConfig (com.thoughtworks.go.config.materials.tfs.TfsMaterialConfig)7 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)4 PipelineConfig (com.thoughtworks.go.config.PipelineConfig)4 MaterialConfigs (com.thoughtworks.go.config.materials.MaterialConfigs)4 MaterialConfig (com.thoughtworks.go.domain.materials.MaterialConfig)4 GoCipher (com.thoughtworks.go.security.GoCipher)4 PackageMaterialConfig (com.thoughtworks.go.config.materials.PackageMaterialConfig)3 PluggableSCMMaterialConfig (com.thoughtworks.go.config.materials.PluggableSCMMaterialConfig)3 ScmMaterialConfig (com.thoughtworks.go.config.materials.ScmMaterialConfig)2 MaterialConfigsMother.filteredHgMaterialConfig (com.thoughtworks.go.helper.MaterialConfigsMother.filteredHgMaterialConfig)2 UrlArgument (com.thoughtworks.go.util.command.UrlArgument)2 Date (java.util.Date)2 Matchers.containsString (org.hamcrest.Matchers.containsString)2 Filter (com.thoughtworks.go.config.materials.Filter)1