use of com.thoughtworks.go.util.command.ProcessOutputStreamConsumer in project gocd by gocd.
the class P4CommandTestBase method shouldBombForNonZeroReturnCode.
@Test
public void shouldBombForNonZeroReturnCode() throws Exception {
ProcessOutputStreamConsumer outputStreamConsumer = Mockito.mock(ProcessOutputStreamConsumer.class);
CommandLine line = Mockito.mock(CommandLine.class);
when(line.run(outputStreamConsumer, null, "foo")).thenReturn(1);
try {
p4.execute(line, "foo", outputStreamConsumer, true);
fail("did't bomb for non zero return code");
} catch (Exception ignored) {
}
verify(line).run(outputStreamConsumer, null, "foo");
}
use of com.thoughtworks.go.util.command.ProcessOutputStreamConsumer in project gocd by gocd.
the class SvnMultipleMaterialsTest method updateMaterials.
private void updateMaterials(Materials materials, Revision revision) {
ProcessOutputStreamConsumer outputStreamConsumer = inMemoryConsumer();
TestSubprocessExecutionContext execCtx = new TestSubprocessExecutionContext();
materials.cleanUp(pipelineDir, outputStreamConsumer);
for (Material material : materials) {
material.updateTo(outputStreamConsumer, pipelineDir, new RevisionContext(revision), execCtx);
}
}
Aggregations