use of com.thoughtworks.go.domain.materials.TestSubprocessExecutionContext in project gocd by gocd.
the class HgMultipleMaterialsTest method shouldIgnoreDestinationFolderWhenServerSide.
@Test
public void shouldIgnoreDestinationFolderWhenServerSide() throws Exception {
HgMaterial material1 = repo.createMaterial("dest1");
MaterialRevision materialRevision = new MaterialRevision(material1, material1.latestModification(pipelineDir, new TestSubprocessExecutionContext()));
materialRevision.updateTo(pipelineDir, ProcessOutputStreamConsumer.inMemoryConsumer(), new TestSubprocessExecutionContext(true));
assertThat(new File(pipelineDir, "dest1").exists(), is(false));
assertThat(new File(pipelineDir, ".hg").exists(), is(true));
}
use of com.thoughtworks.go.domain.materials.TestSubprocessExecutionContext in project gocd by gocd.
the class HgMultipleMaterialsTest method shouldFindModificationsForBothMaterials.
@Test
public void shouldFindModificationsForBothMaterials() throws Exception {
Materials materials = new Materials(repo.createMaterial("dest1"), repo.createMaterial("dest2"));
repo.commitAndPushFile("SomeDocumentation.txt");
MaterialRevisions materialRevisions = materials.latestModification(pipelineDir, new TestSubprocessExecutionContext());
assertThat(materialRevisions.getRevisions().size(), is(2));
assertThat(materialRevisions, containsModifiedBy("SomeDocumentation.txt", "user"));
}
use of com.thoughtworks.go.domain.materials.TestSubprocessExecutionContext 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.TestSubprocessExecutionContext in project gocd by gocd.
the class P4MaterialTestBase method shouldReplacePasswordUsingStar.
@Test
public void shouldReplacePasswordUsingStar() throws Exception {
P4Material p4Material = new P4Material("localhost:9876", "p4view");
p4Material.setPassword("secret");
p4Material.setUseTickets(true);
try {
p4Material.latestModification(clientFolder, new TestSubprocessExecutionContext());
fail("should throw exception because p4 server not exists.");
} catch (Exception e) {
assertThat(e.getMessage(), not(containsString("secret")));
}
}
use of com.thoughtworks.go.domain.materials.TestSubprocessExecutionContext in project gocd by gocd.
the class P4MaterialTestBase method shouldValidateCorrectConnection.
@Test
public void shouldValidateCorrectConnection() throws Exception {
P4Material p4Material = p4Fixture.material(VIEW);
p4Material.setPassword("secret");
p4Material.setUseTickets(false);
ValidationBean validation = p4Material.checkConnection(new TestSubprocessExecutionContext());
assertThat(validation.isValid(), is(true));
assertThat(StringUtils.isBlank(validation.getError()), is(true));
}
Aggregations