Lines Matching defs:cache
15 package com.google.common.cache;
17 import static com.google.common.cache.TestingCacheLoaders.incrementingLoader;
20 import com.google.common.cache.TestingCacheLoaders.IncrementingLoader;
26 * Tests relating to automatic cache refreshing.
34 LoadingCache<Integer, Integer> cache = CacheBuilder.newBuilder()
43 assertEquals(Integer.valueOf(i), cache.getUnchecked(i));
50 assertEquals(Integer.valueOf(0), cache.getUnchecked(0));
51 assertEquals(Integer.valueOf(1), cache.getUnchecked(1));
52 assertEquals(Integer.valueOf(2), cache.getUnchecked(2));
58 assertEquals(Integer.valueOf(1), cache.getUnchecked(0));
60 assertEquals(Integer.valueOf(1), cache.getUnchecked(1));
61 assertEquals(Integer.valueOf(2), cache.getUnchecked(2));
66 cache.asMap().put(1, -1);
68 assertEquals(Integer.valueOf(1), cache.getUnchecked(0));
69 assertEquals(Integer.valueOf(-1), cache.getUnchecked(1));
70 assertEquals(Integer.valueOf(2), cache.getUnchecked(2));
76 assertEquals(Integer.valueOf(1), cache.getUnchecked(0));
77 assertEquals(Integer.valueOf(-1), cache.getUnchecked(1));
78 assertEquals(Integer.valueOf(3), cache.getUnchecked(2));
84 assertEquals(Integer.valueOf(1), cache.getUnchecked(0));
85 assertEquals(Integer.valueOf(-1), cache.getUnchecked(1));
86 assertEquals(Integer.valueOf(3), cache.getUnchecked(2));
92 assertEquals(Integer.valueOf(2), cache.getUnchecked(0));
94 assertEquals(Integer.valueOf(0), cache.getUnchecked(1));
96 assertEquals(Integer.valueOf(3), cache.getUnchecked(2));