use of com.thoughtworks.go.domain.materials.mercurial.StringRevision in project gocd by gocd.
the class HgMaterialTest method shouldUpdateToSpecificRevision.
@Test
public void shouldUpdateToSpecificRevision() throws Exception {
updateMaterial(hgMaterial, new StringRevision("0"));
File end2endFolder = new File(workingFolder, "end2end");
assertThat(end2endFolder.listFiles().length, is(3));
assertThat(outputStreamConsumer.getStdOut(), is(not("")));
updateMaterial(hgMaterial, new StringRevision("1"));
assertThat(end2endFolder.listFiles().length, is(4));
}
use of com.thoughtworks.go.domain.materials.mercurial.StringRevision in project gocd by gocd.
the class HgMaterialUpdaterTest method shouldLogRepoInfoToConsoleOutWithoutFolder.
@Test
public void shouldLogRepoInfoToConsoleOutWithoutFolder() throws Exception {
updateTo(hgMaterial, new RevisionContext(new StringRevision("0")), JobResult.Passed);
assertThat(console.output(), containsString(format("Start updating %s at revision %s from %s", "files", "0", hgMaterial.getUrl())));
}
use of com.thoughtworks.go.domain.materials.mercurial.StringRevision in project gocd by gocd.
the class HgMaterialUpdaterTest method shouldPullNewChangesFromRemoteBeforeUpdating.
@Test
public void shouldPullNewChangesFromRemoteBeforeUpdating() throws Exception {
File newWorkingFolder = temporaryFolder.newFolder("newWorkingFolder");
updateTo(hgMaterial, new RevisionContext(REVISION_0), JobResult.Passed);
String repositoryUrl = hgTestRepo.projectRepositoryUrl();
HgMaterial material = MaterialsMother.hgMaterial(repositoryUrl);
assertThat(material.getUrl(), is(hgMaterial.getUrl()));
updateTo(material, new RevisionContext(REVISION_0), JobResult.Passed, newWorkingFolder);
hgTestRepo.commitAndPushFile("SomeDocumentation.txt", "whatever");
List<Modification> modification = hgMaterial.latestModification(workingFolder, new TestSubprocessExecutionContext());
StringRevision revision = new StringRevision(modification.get(0).getRevision());
updateTo(material, new RevisionContext(revision), JobResult.Passed, newWorkingFolder);
assertThat(console.output(), containsString("Start updating files at revision " + revision.getRevision()));
}
use of com.thoughtworks.go.domain.materials.mercurial.StringRevision in project gocd by gocd.
the class P4MaterialTestBase method shouldMapDirectoryInRepoToDirectoryUnderClientRoot.
@Test
public void shouldMapDirectoryInRepoToDirectoryUnderClientRoot() throws Exception {
P4Material p4Material = p4Fixture.material("//depot/lib/... //cws/release1/...");
updateMaterial(p4Material, new StringRevision("2"));
assertThat(getContainedFileNames(new File(clientFolder, "release1")), hasItem("junit.jar"));
}
use of com.thoughtworks.go.domain.materials.mercurial.StringRevision in project gocd by gocd.
the class P4MaterialTestBase method shouldSupportAsterisk.
@Test
public void shouldSupportAsterisk() throws Exception {
P4Material p4Material = p4Fixture.material("//depot/lib/*.jar //cws/*.war");
updateMaterial(p4Material, new StringRevision("2"));
File file = new File(clientFolder, "junit.war");
assertThat(file.exists(), is(true));
}
Aggregations