use of com.thoughtworks.go.domain.materials.TestSubprocessExecutionContext in project gocd by gocd.
the class P4MultipleMaterialsTest method shouldUpdateToItsDestFolder.
@Test
public void shouldUpdateToItsDestFolder() {
P4Material p4Material = p4Fixture.material(VIEW_SRC, "dest1");
MaterialRevision revision = new MaterialRevision(p4Material, p4Material.latestModification(clientFolder, new TestSubprocessExecutionContext()));
revision.updateTo(clientFolder, inMemoryConsumer(), new TestSubprocessExecutionContext());
assertThat(new File(clientFolder, "dest1/net").exists(), is(true));
}
use of com.thoughtworks.go.domain.materials.TestSubprocessExecutionContext in project gocd by gocd.
the class P4MultipleMaterialsTest method shouldFoundModificationsForEachMaterial.
@Test
public void shouldFoundModificationsForEachMaterial() throws Exception {
P4Material p4Material1 = p4Fixture.material(VIEW_SRC, "src");
P4Material p4Material2 = p4Fixture.material(VIEW_LIB, "lib");
Materials materials = new Materials(p4Material1, p4Material2);
p4TestRepo.checkInOneFile(p4Material1, "filename.txt");
p4TestRepo.checkInOneFile(p4Material2, "filename2.txt");
MaterialRevisions materialRevisions = materials.latestModification(clientFolder, new TestSubprocessExecutionContext());
assertThat(materialRevisions.getRevisions().size(), is(2));
assertThat(materialRevisions, containsModifiedFile("src/filename.txt"));
assertThat(materialRevisions, containsModifiedFile("lib/filename2.txt"));
}
use of com.thoughtworks.go.domain.materials.TestSubprocessExecutionContext in project gocd by gocd.
the class GitCommandTest method shouldCheckIfRemoteRepoExists.
@Test
public void shouldCheckIfRemoteRepoExists() throws Exception {
GitCommand gitCommand = new GitCommand(null, null, null, false, null, null);
final TestSubprocessExecutionContext executionContext = new TestSubprocessExecutionContext();
gitCommand.checkConnection(git.workingRepositoryUrl(), "master", executionContext.getDefaultEnvironmentVariables());
}
use of com.thoughtworks.go.domain.materials.TestSubprocessExecutionContext in project gocd by gocd.
the class GitCommandTest method shouldThrowExceptionWhenRepoNotExist.
@Test(expected = Exception.class)
public void shouldThrowExceptionWhenRepoNotExist() throws Exception {
GitCommand gitCommand = new GitCommand(null, null, null, false, null, null);
final TestSubprocessExecutionContext executionContext = new TestSubprocessExecutionContext();
gitCommand.checkConnection(new UrlArgument("git://somewhere.is.not.exist"), "master", executionContext.getDefaultEnvironmentVariables());
}
use of com.thoughtworks.go.domain.materials.TestSubprocessExecutionContext in project gocd by gocd.
the class GitMultipleMaterialsTest method shouldCloneMaterialToItsDestFolder.
@Test
public void shouldCloneMaterialToItsDestFolder() throws Exception {
GitMaterial material1 = repo.createMaterial("dest1");
MaterialRevision materialRevision = new MaterialRevision(material1, material1.latestModification(pipelineDir, new TestSubprocessExecutionContext()));
materialRevision.updateTo(pipelineDir, ProcessOutputStreamConsumer.inMemoryConsumer(), new TestSubprocessExecutionContext());
assertThat(new File(pipelineDir, "dest1").exists(), is(true));
assertThat(new File(pipelineDir, "dest1/.git").exists(), is(true));
}
Aggregations