Examples of nowMillis()


Examples of com.twitter.common.util.Clock.nowMillis()

    final ScheduledExecutorService executor = createMock(ScheduledExecutorService.class);
    FakeScheduledExecutor executorClock =
        FakeScheduledExecutor.scheduleAtFixedRateExecutor(executor, 2);

    Clock mockClock = createMock(Clock.class);
    expect(mockClock.nowMillis()).andReturn(2L).times(2);

    expect(storageUtil.jobUpdateStore.pruneHistory(1, 1)).andReturn(ImmutableSet.of("id1", "id2"));
    expect(storageUtil.jobUpdateStore.pruneHistory(1, 1)).andReturn(ImmutableSet.<String>of());

    control.replay();
View Full Code Here

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

  @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();

    lockManager = new LockManagerImpl(MemStorage.newEmptyStorage(), clock, tokenGenerator);
View Full Code Here

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

    Capture<String> names = new Capture<>(CaptureType.ALL);
    expect(untracked.makeGauge(EasyMock.capture(names), EasyMock.<Supplier<Number>>anyObject()))
        .andReturn(EasyMock.<Stat<Number>>anyObject())
        .anyTimes();

    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));
View Full Code Here

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

    expect(untracked.makeGauge(EasyMock.capture(names), EasyMock.<Supplier<Number>>anyObject()))
        .andReturn(EasyMock.<Stat<Number>>anyObject())
        .anyTimes();

    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);
View Full Code Here

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

        .andReturn(EasyMock.<Stat<Number>>anyObject())
        .anyTimes();

    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();
View Full Code Here

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

        .anyTimes();

    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();
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.