Package com.twitter.common.util.testing

Examples of com.twitter.common.util.testing.FakeClock.advance()


  public ExpectedException expectedException = ExpectedException.none();

  @Before
  public void setUp() throws Exception {
    FakeClock clock = new FakeClock();
    clock.advance(Amount.of(12345L, Time.SECONDS));
    timestampMs = clock.nowMillis();

    UUIDGenerator tokenGenerator = createMock(UUIDGenerator.class);
    EasyMock.expect(tokenGenerator.createNew()).andReturn(TOKEN).anyTimes();
View Full Code Here


    IScheduledTask task1 = makeTask(ImmutableMap.of(clock.nowMillis() - 1000, PENDING), 0);
    IScheduledTask task2 = makeTask(ImmutableMap.of(clock.nowMillis() - 2000, PENDING), 1);
    IScheduledTask task3 = makeTask(ImmutableMap.of(clock.nowMillis() - 3000, PENDING), 2);
    IScheduledTask task4 = makeTask(ImmutableMap.of(clock.nowMillis() - 4000, PENDING), 3, false);

    clock.advance(Amount.of(10L, Time.SECONDS));
    storageUtil.expectTaskFetch(Query.unscoped(), task1, task2, task3, task4);
    storageUtil.expectOperations();

    control.replay();
    calculator.run();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.