Java 类com.google.common.cache.CacheTesting.Receiver 实例源码

项目:guava-mock    文件:CacheEvictionTest.java   
public void testUpdateRecency_onGet() {
  IdentityLoader<Integer> loader = identityLoader();
  final LoadingCache<Integer, Integer> cache =
      CacheBuilder.newBuilder().maximumSize(MAX_SIZE).build(loader);
  CacheTesting.checkRecency(cache, MAX_SIZE,
      new Receiver<ReferenceEntry<Integer, Integer>>() {
        @Override
        public void accept(ReferenceEntry<Integer, Integer> entry) {
          cache.getUnchecked(entry.getKey());
        }
      });
}
项目:guava-mock    文件:CacheEvictionTest.java   
public void testUpdateRecency_onInvalidate() {
  IdentityLoader<Integer> loader = identityLoader();
  final LoadingCache<Integer, Integer> cache = CacheBuilder.newBuilder()
      .maximumSize(MAX_SIZE)
      .concurrencyLevel(1)
      .build(loader);
  CacheTesting.checkRecency(cache, MAX_SIZE,
      new Receiver<ReferenceEntry<Integer, Integer>>() {
        @Override
        public void accept(ReferenceEntry<Integer, Integer> entry) {
          Integer key = entry.getKey();
          cache.invalidate(key);
        }
      });
}
项目:googles-monorepo-demo    文件:CacheEvictionTest.java   
public void testUpdateRecency_onGet() {
  IdentityLoader<Integer> loader = identityLoader();
  final LoadingCache<Integer, Integer> cache =
      CacheBuilder.newBuilder().maximumSize(MAX_SIZE).build(loader);
  CacheTesting.checkRecency(cache, MAX_SIZE,
      new Receiver<ReferenceEntry<Integer, Integer>>() {
        @Override
        public void accept(ReferenceEntry<Integer, Integer> entry) {
          cache.getUnchecked(entry.getKey());
        }
      });
}
项目:googles-monorepo-demo    文件:CacheEvictionTest.java   
public void testUpdateRecency_onInvalidate() {
  IdentityLoader<Integer> loader = identityLoader();
  final LoadingCache<Integer, Integer> cache = CacheBuilder.newBuilder()
      .maximumSize(MAX_SIZE)
      .concurrencyLevel(1)
      .build(loader);
  CacheTesting.checkRecency(cache, MAX_SIZE,
      new Receiver<ReferenceEntry<Integer, Integer>>() {
        @Override
        public void accept(ReferenceEntry<Integer, Integer> entry) {
          Integer key = entry.getKey();
          cache.invalidate(key);
        }
      });
}
项目:guava-libraries    文件:CacheEvictionTest.java   
public void testUpdateRecency_onGet() {
  IdentityLoader<Integer> loader = identityLoader();
  final LoadingCache<Integer, Integer> cache =
      CacheBuilder.newBuilder().maximumSize(MAX_SIZE).build(loader);
  CacheTesting.checkRecency(cache, MAX_SIZE,
      new Receiver<ReferenceEntry<Integer, Integer>>() {
        @Override
        public void accept(ReferenceEntry<Integer, Integer> entry) {
          cache.getUnchecked(entry.getKey());
        }
      });
}
项目:guava-libraries    文件:CacheEvictionTest.java   
public void testUpdateRecency_onInvalidate() {
  IdentityLoader<Integer> loader = identityLoader();
  final LoadingCache<Integer, Integer> cache = CacheBuilder.newBuilder()
      .maximumSize(MAX_SIZE)
      .concurrencyLevel(1)
      .build(loader);
  CacheTesting.checkRecency(cache, MAX_SIZE,
      new Receiver<ReferenceEntry<Integer, Integer>>() {
        @Override
        public void accept(ReferenceEntry<Integer, Integer> entry) {
          Integer key = entry.getKey();
          cache.invalidate(key);
        }
      });
}
项目:guava    文件:CacheEvictionTest.java   
public void testUpdateRecency_onGet() {
  IdentityLoader<Integer> loader = identityLoader();
  final LoadingCache<Integer, Integer> cache =
      CacheBuilder.newBuilder().maximumSize(MAX_SIZE).build(loader);
  CacheTesting.checkRecency(
      cache,
      MAX_SIZE,
      new Receiver<ReferenceEntry<Integer, Integer>>() {
        @Override
        public void accept(ReferenceEntry<Integer, Integer> entry) {
          cache.getUnchecked(entry.getKey());
        }
      });
}
项目:guava    文件:CacheEvictionTest.java   
public void testUpdateRecency_onInvalidate() {
  IdentityLoader<Integer> loader = identityLoader();
  final LoadingCache<Integer, Integer> cache =
      CacheBuilder.newBuilder().maximumSize(MAX_SIZE).concurrencyLevel(1).build(loader);
  CacheTesting.checkRecency(
      cache,
      MAX_SIZE,
      new Receiver<ReferenceEntry<Integer, Integer>>() {
        @Override
        public void accept(ReferenceEntry<Integer, Integer> entry) {
          Integer key = entry.getKey();
          cache.invalidate(key);
        }
      });
}
项目:guava    文件:CacheEvictionTest.java   
public void testUpdateRecency_onGet() {
  IdentityLoader<Integer> loader = identityLoader();
  final LoadingCache<Integer, Integer> cache =
      CacheBuilder.newBuilder().maximumSize(MAX_SIZE).build(loader);
  CacheTesting.checkRecency(
      cache,
      MAX_SIZE,
      new Receiver<ReferenceEntry<Integer, Integer>>() {
        @Override
        public void accept(ReferenceEntry<Integer, Integer> entry) {
          cache.getUnchecked(entry.getKey());
        }
      });
}
项目:guava    文件:CacheEvictionTest.java   
public void testUpdateRecency_onInvalidate() {
  IdentityLoader<Integer> loader = identityLoader();
  final LoadingCache<Integer, Integer> cache =
      CacheBuilder.newBuilder().maximumSize(MAX_SIZE).concurrencyLevel(1).build(loader);
  CacheTesting.checkRecency(
      cache,
      MAX_SIZE,
      new Receiver<ReferenceEntry<Integer, Integer>>() {
        @Override
        public void accept(ReferenceEntry<Integer, Integer> entry) {
          Integer key = entry.getKey();
          cache.invalidate(key);
        }
      });
}