use of com.thoughtworks.go.domain.materials.mercurial.StringRevision in project gocd by gocd.
the class P4MaterialTestBase method shouldMapDirectoryInRepoToClientRoot.
@Test
public void shouldMapDirectoryInRepoToClientRoot() throws Exception {
P4Material p4Material = p4Fixture.material("//depot/lib/... //cws/...");
updateMaterial(p4Material, new StringRevision("2"));
assertThat(getContainedFileNames(clientFolder), hasItem("junit.jar"));
}
use of com.thoughtworks.go.domain.materials.mercurial.StringRevision in project gocd by gocd.
the class P4MaterialTestBase method shouldSupportPercetage.
@Test
public void shouldSupportPercetage() throws Exception {
P4Material p4Material = p4Fixture.material("//depot/lib/%%1.%%2 //cws/%%2.%%1");
updateMaterial(p4Material, new StringRevision("2"));
File file = new File(clientFolder, "jar.junit");
assertThat(file.exists(), is(true));
}
use of com.thoughtworks.go.domain.materials.mercurial.StringRevision in project gocd by gocd.
the class P4MaterialTestBase method shouldUpdateToSpecificRevision.
@Test
public void shouldUpdateToSpecificRevision() throws Exception {
P4Material p4Material = p4Fixture.material(VIEW);
updateMaterial(p4Material, new StringRevision("2"));
assertThat(clientFolder.listFiles().length, is(8));
updateMaterial(p4Material, new StringRevision("3"));
assertThat(clientFolder.listFiles().length, is(7));
}
use of com.thoughtworks.go.domain.materials.mercurial.StringRevision in project gocd by gocd.
the class P4MaterialTestBase method shouldCleanOutRepoWhenMaterialChanges.
@Test
public void shouldCleanOutRepoWhenMaterialChanges() throws Exception {
P4TestRepo secondTestRepo = P4TestRepo.createP4TestRepo(temporaryFolder, clientFolder);
try {
secondTestRepo.onSetup();
P4Material p4Material = p4Fixture.material(VIEW);
updateMaterial(p4Material, new StringRevision("2"));
File.createTempFile("temp", "txt", clientFolder);
assertThat(clientFolder.listFiles().length, is(9));
P4Material otherMaterial = secondTestRepo.material("//depot/lib/... //something/...");
otherMaterial.setUsername("cceuser1");
updateMaterial(otherMaterial, new StringRevision("2"));
File.createTempFile("temp", "txt", clientFolder);
assertThat("Should clean and re-checkout after p4repo changed", clientFolder.listFiles().length, is(3));
otherMaterial.setUsername("cceuser");
otherMaterial.setPassword("password");
updateMaterial(otherMaterial, new StringRevision("2"));
assertThat("Should clean and re-checkout after user changed", clientFolder.listFiles().length, is(2));
assertThat(outputconsumer.getStdOut(), containsString("Working directory has changed. Deleting and re-creating it."));
} finally {
secondTestRepo.stop();
secondTestRepo.onTearDown();
}
}
use of com.thoughtworks.go.domain.materials.mercurial.StringRevision in project gocd by gocd.
the class P4MaterialTestBase method laterDefinitionShouldMergeWithPreviousOneWhenPlusPresent.
@Test
public void laterDefinitionShouldMergeWithPreviousOneWhenPlusPresent() throws Exception {
P4Material p4Material = p4Fixture.material("//depot/src/... //cws/build/... \n +//depot/lib/... //cws/build/...");
File file = new File(clientFolder, "build/junit.jar");
File folderNet = new File(clientFolder, "build/net");
updateMaterial(p4Material, new StringRevision("2"));
assertThat(folderNet.exists(), is(true));
assertThat(file.exists(), is(true));
}
Aggregations