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