use of com.thoughtworks.go.domain.materials.mercurial.StringRevision in project gocd by gocd.
the class HgMaterialTest method shouldGetModifications.
@Test
public void shouldGetModifications() throws Exception {
List<Modification> mods = hgMaterial.modificationsSince(workingFolder, new StringRevision(REVISION_0), new TestSubprocessExecutionContext());
assertThat(mods.size(), is(2));
Modification modification = mods.get(0);
assertThat(modification.getRevision(), is(REVISION_2));
assertThat(modification.getModifiedFiles().size(), is(1));
}
use of com.thoughtworks.go.domain.materials.mercurial.StringRevision in project gocd by gocd.
the class HgMaterialTest method shouldLogRepoInfoToConsoleOutWithoutFolder.
@Test
public void shouldLogRepoInfoToConsoleOutWithoutFolder() throws Exception {
updateMaterial(hgMaterial, new StringRevision("0"));
assertThat(outputStreamConsumer.getStdOut(), 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 P4MaterialTestBase method shouldExcludeSpecifiedDirectory.
@Test
void shouldExcludeSpecifiedDirectory() {
P4Material p4Material = p4Fixture.material("//depot/... //cws/... \n -//depot/lib/... //cws/release1/...");
updateMaterial(p4Material, new StringRevision("2"));
assertThat(new File(clientFolder, "release1").exists()).isFalse();
assertThat(new File(clientFolder, "release1/junit.jar").exists()).isFalse();
}
use of com.thoughtworks.go.domain.materials.mercurial.StringRevision in project gocd by gocd.
the class P4MaterialTestBase method shouldBeAbleToConvertToJson.
@Test
void shouldBeAbleToConvertToJson() {
P4Material p4Material = p4Fixture.material(VIEW);
Map<String, Object> json = new LinkedHashMap<>();
p4Material.toJson(json, new StringRevision("123"));
JsonValue jsonValue = from(json);
assertThat(jsonValue.getString("scmType")).isEqualTo("Perforce");
assertThat(jsonValue.getString("location")).isEqualTo(p4Material.getServerAndPort());
assertThat(jsonValue.getString("action")).isEqualTo("Modified");
}
use of com.thoughtworks.go.domain.materials.mercurial.StringRevision in project gocd by gocd.
the class P4MaterialTestBase method laterDefinitionShouldOveridePreviousOne.
@Test
void laterDefinitionShouldOveridePreviousOne() {
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()).isFalse();
assertThat(file.exists()).isTrue();
}
Aggregations