use of com.thoughtworks.go.domain.materials.RevisionContext in project gocd by gocd.
the class HgMaterialUpdaterTest method failureCommandShouldNotLeakPasswordOnUrl.
@Test
public void failureCommandShouldNotLeakPasswordOnUrl() throws Exception {
HgMaterial material = MaterialsMother.hgMaterial("https://foo:foopassword@this.is.absolute.not.exists");
updateTo(material, new RevisionContext(REVISION_1), JobResult.Failed);
assertThat(console.output(), containsString("https://foo:******@this.is.absolute.not.exists"));
assertThat(console.output(), not(containsString("foopassword")));
}
use of com.thoughtworks.go.domain.materials.RevisionContext in project gocd by gocd.
the class HgMaterialUpdaterTest method shouldCreateBuildCommandUpdateToSpecificRevision.
@Test
public void shouldCreateBuildCommandUpdateToSpecificRevision() throws Exception {
File newFile = new File(workingFolder, "end2end/revision2.txt");
updateTo(hgMaterial, new RevisionContext(REVISION_0), JobResult.Passed);
assertThat(console.output(), containsString("Start updating files at revision " + REVISION_0.getRevision()));
assertThat(newFile.exists(), is(false));
console.clear();
updateTo(hgMaterial, new RevisionContext(REVISION_2, REVISION_1, 2), JobResult.Passed);
assertThat(console.output(), containsString("Start updating files at revision " + REVISION_2.getRevision()));
assertThat(newFile.exists(), is(true));
}
use of com.thoughtworks.go.domain.materials.RevisionContext in project gocd by gocd.
the class P4MaterialUpdaterTest method shouldNotDisplayPassword.
@Test
public void shouldNotDisplayPassword() throws Exception {
P4Material material = p4Fixture.material(VIEW);
material.setPassword("wubba lubba dub dub");
updateTo(material, new RevisionContext(REVISION_2), JobResult.Passed);
assertThat(console.output(), not(containsString("wubba lubba dub dub")));
}
use of com.thoughtworks.go.domain.materials.RevisionContext in project gocd by gocd.
the class P4MaterialUpdaterTestBase method shouldSyncToSpecifiedRevision.
@Test
public void shouldSyncToSpecifiedRevision() throws Exception {
P4Material material = p4Fixture.material(VIEW);
updateTo(material, new RevisionContext(REVISION_2), JobResult.Passed);
assertThat(workingDir.listFiles().length, is(7));
updateTo(material, new RevisionContext(REVISION_3), JobResult.Passed);
assertThat(workingDir.listFiles().length, is(6));
}
use of com.thoughtworks.go.domain.materials.RevisionContext in project gocd by gocd.
the class P4MaterialUpdaterTestBase method shouldNotFailIfDestDoesNotExist.
@Test
public void shouldNotFailIfDestDoesNotExist() throws Exception {
FileUtils.deleteDirectory(workingDir);
assert (!workingDir.exists());
P4Material material = p4Fixture.material(VIEW);
updateTo(material, new RevisionContext(REVISION_2), JobResult.Passed);
assert (workingDir.exists());
}
Aggregations