use of com.thoughtworks.go.util.TestingClock in project gocd by gocd.
the class DownloadActionTest method setUp.
@Before
public void setUp() throws Exception {
clock = new TestingClock();
fetchHandler = mock(FetchHandler.class);
publisher = new StubGoPublisher();
}
use of com.thoughtworks.go.util.TestingClock in project gocd by gocd.
the class ServerHealthStateTest method setUp.
@Before
public void setUp() {
testingClock = new TestingClock();
ServerHealthState.clock = testingClock;
}
use of com.thoughtworks.go.util.TestingClock in project gocd by gocd.
the class StreamPumperTest method shouldNotHaveExpiredTimeoutWhenCompleted.
@Test
public void shouldNotHaveExpiredTimeoutWhenCompleted() throws Exception {
PipedOutputStream output = new PipedOutputStream();
InputStream inputStream = new PipedInputStream(output);
TestingClock clock = new TestingClock();
StreamPumper pumper = new StreamPumper(inputStream, new TestConsumer(), "", null, clock);
new Thread(pumper).start();
output.write("line1\n".getBytes());
output.flush();
output.close();
pumper.readToEnd();
clock.addSeconds(2);
assertThat(pumper.didTimeout(1L, TimeUnit.SECONDS), is(false));
}
use of com.thoughtworks.go.util.TestingClock in project gocd by gocd.
the class FetchArtifactBuilderTest method setUp.
@Before
public void setUp() throws Exception {
File folder = TestFileUtil.createTempFolder("log");
File consolelog = new File(folder, "console.log");
folder.mkdirs();
consolelog.createNewFile();
zip = new ZipUtil().zip(folder, TestFileUtil.createUniqueTempFile(folder.getName()), Deflater.NO_COMPRESSION);
toClean.add(folder);
toClean.add(zip);
dest = new File("dest");
dest.mkdirs();
toClean.add(dest);
clock = new TestingClock();
publisher = new StubGoPublisher();
checksumFileHandler = mock(ChecksumFileHandler.class);
urlService = mock(URLService.class);
downloadAction = mock(DownloadAction.class);
}
use of com.thoughtworks.go.util.TestingClock in project gocd by gocd.
the class BuildVariablesTest method setup.
@Before
public void setup() {
AgentIdentifier agentIdentifier = new AgentIdentifier("duloc", "127.0.0.1", "uuid");
AgentRuntimeInfo runtimeInfo = new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, "/home/lord-farquaad/builds", "cookie", false);
bvs = new BuildVariables(runtimeInfo, new TestingClock(new Date(0)));
}
Aggregations