Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for FakeTicker (0.07 sec)

  1. guava-testlib/src/com/google/common/testing/FakeTicker.java

    @ElementTypesAreNonnullByDefault
    @GwtCompatible
    public class FakeTicker extends Ticker {
    
      private final AtomicLong nanos = new AtomicLong();
      private volatile long autoIncrementStepNanos;
    
      /** Advances the ticker value by {@code time} in {@code timeUnit}. */
      @SuppressWarnings("GoodTime") // should accept a java.time.Duration
      @CanIgnoreReturnValue
      public FakeTicker advance(long time, TimeUnit timeUnit) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  2. android/guava-testlib/src/com/google/common/testing/FakeTicker.java

    @ElementTypesAreNonnullByDefault
    @GwtCompatible
    public class FakeTicker extends Ticker {
    
      private final AtomicLong nanos = new AtomicLong();
      private volatile long autoIncrementStepNanos;
    
      /** Advances the ticker value by {@code time} in {@code timeUnit}. */
      @SuppressWarnings("GoodTime") // should accept a java.time.Duration
      @CanIgnoreReturnValue
      public FakeTicker advance(long time, TimeUnit timeUnit) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  3. android/guava-testlib/test/com/google/common/testing/FakeTickerTest.java

        assertEquals(2000010L, ticker.read());
      }
    
      public void testAutoIncrementStep_returnsSameInstance() {
        FakeTicker ticker = new FakeTicker();
        assertSame(ticker, ticker.setAutoIncrementStep(10, NANOSECONDS));
      }
    
      public void testAutoIncrementStep_nanos() {
        FakeTicker ticker = new FakeTicker().setAutoIncrementStep(10, NANOSECONDS);
        assertEquals(0, ticker.read());
        assertEquals(10, ticker.read());
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Oct 22 13:49:09 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/cache/CacheBuilderGwtTest.java

     *
     * @author Jon Donovan
     */
    @GwtCompatible
    public class CacheBuilderGwtTest extends TestCase {
    
      private FakeTicker fakeTicker;
    
      @Override
      protected void setUp() throws Exception {
        super.setUp();
    
        fakeTicker = new FakeTicker();
      }
    
      public void testLoader() throws ExecutionException {
    
        final Cache<Integer, Integer> cache = CacheBuilder.newBuilder().build();
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 14.4K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/base/StopwatchTest.java

    import com.google.common.annotations.J2ktIncompatible;
    import com.google.common.testing.FakeTicker;
    import junit.framework.TestCase;
    
    /**
     * Unit test for {@link Stopwatch}.
     *
     * @author Kevin Bourrillion
     */
    @GwtCompatible
    public class StopwatchTest extends TestCase {
    
      private final FakeTicker ticker = new FakeTicker();
      private final Stopwatch stopwatch = new Stopwatch(ticker);
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Sep 17 18:14:12 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/base/StopwatchTest.java

    import com.google.common.annotations.J2ktIncompatible;
    import com.google.common.testing.FakeTicker;
    import junit.framework.TestCase;
    
    /**
     * Unit test for {@link Stopwatch}.
     *
     * @author Kevin Bourrillion
     */
    @GwtCompatible
    public class StopwatchTest extends TestCase {
    
      private final FakeTicker ticker = new FakeTicker();
      private final Stopwatch stopwatch = new Stopwatch(ticker);
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Sep 17 18:14:12 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/cache/CacheLoadingTest.java

        assertEquals(1, stats.hitCount());
      }
    
      public void testRefresh() {
        final Object one = new Object();
        final Object two = new Object();
        FakeTicker ticker = new FakeTicker();
        CacheLoader<Object, Object> loader =
            new CacheLoader<Object, Object>() {
              @Override
              public Object load(Object key) {
                return one;
              }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 86.3K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/cache/LocalCacheTest.java

            makeLocalCache(createCacheBuilder().refreshAfterWrite(duration, unit));
        assertEquals(unit.toNanos(duration), map.refreshNanos);
      }
    
      public void testLongAsyncRefresh() throws Exception {
        FakeTicker ticker = new FakeTicker();
        CountDownLatch reloadStarted = new CountDownLatch(1);
        SettableFuture<Thread> threadAboutToBlockForRefresh = SettableFuture.create();
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 110.6K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/cache/LocalCacheTest.java

            makeLocalCache(createCacheBuilder().refreshAfterWrite(duration, unit));
        assertEquals(unit.toNanos(duration), map.refreshNanos);
      }
    
      public void testLongAsyncRefresh() throws Exception {
        FakeTicker ticker = new FakeTicker();
        CountDownLatch reloadStarted = new CountDownLatch(1);
        SettableFuture<Thread> threadAboutToBlockForRefresh = SettableFuture.create();
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 112.3K bytes
    - Viewed (0)
Back to top