aboutsummaryrefslogtreecommitdiffstats
path: root/guava-tests/test/com/google/common/cache/CacheEvictionTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'guava-tests/test/com/google/common/cache/CacheEvictionTest.java')
-rw-r--r--guava-tests/test/com/google/common/cache/CacheEvictionTest.java36
1 files changed, 18 insertions, 18 deletions
diff --git a/guava-tests/test/com/google/common/cache/CacheEvictionTest.java b/guava-tests/test/com/google/common/cache/CacheEvictionTest.java
index 4011542..64e322e 100644
--- a/guava-tests/test/com/google/common/cache/CacheEvictionTest.java
+++ b/guava-tests/test/com/google/common/cache/CacheEvictionTest.java
@@ -19,7 +19,7 @@ import static com.google.common.cache.TestingRemovalListeners.countingRemovalLis
import static com.google.common.cache.TestingWeighers.constantWeigher;
import static com.google.common.cache.TestingWeighers.intKeyWeigher;
import static java.util.Arrays.asList;
-import static org.truth0.Truth.ASSERT;
+import static org.junit.contrib.truth.Truth.ASSERT;
import com.google.common.cache.CacheTesting.Receiver;
import com.google.common.cache.LocalCache.ReferenceEntry;
@@ -169,27 +169,27 @@ public class CacheEvictionTest extends TestCase {
.build(loader);
CacheTesting.warmUp(cache, 0, 10);
Set<Integer> keySet = cache.asMap().keySet();
- ASSERT.that(keySet).has().allOf(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+ ASSERT.that(keySet).hasContentsAnyOrder(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
// re-order
getAll(cache, asList(0, 1, 2));
CacheTesting.drainRecencyQueues(cache);
- ASSERT.that(keySet).has().allOf(3, 4, 5, 6, 7, 8, 9, 0, 1, 2);
+ ASSERT.that(keySet).hasContentsAnyOrder(3, 4, 5, 6, 7, 8, 9, 0, 1, 2);
// evict 3, 4, 5
getAll(cache, asList(10, 11, 12));
CacheTesting.drainRecencyQueues(cache);
- ASSERT.that(keySet).has().allOf(6, 7, 8, 9, 0, 1, 2, 10, 11, 12);
+ ASSERT.that(keySet).hasContentsAnyOrder(6, 7, 8, 9, 0, 1, 2, 10, 11, 12);
// re-order
getAll(cache, asList(6, 7, 8));
CacheTesting.drainRecencyQueues(cache);
- ASSERT.that(keySet).has().allOf(9, 0, 1, 2, 10, 11, 12, 6, 7, 8);
+ ASSERT.that(keySet).hasContentsAnyOrder(9, 0, 1, 2, 10, 11, 12, 6, 7, 8);
// evict 9, 0, 1
getAll(cache, asList(13, 14, 15));
CacheTesting.drainRecencyQueues(cache);
- ASSERT.that(keySet).has().allOf(2, 10, 11, 12, 6, 7, 8, 13, 14, 15);
+ ASSERT.that(keySet).hasContentsAnyOrder(2, 10, 11, 12, 6, 7, 8, 13, 14, 15);
}
public void testEviction_weightedLru() {
@@ -202,37 +202,37 @@ public class CacheEvictionTest extends TestCase {
.build(loader);
CacheTesting.warmUp(cache, 0, 10);
Set<Integer> keySet = cache.asMap().keySet();
- ASSERT.that(keySet).has().allOf(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+ ASSERT.that(keySet).hasContentsAnyOrder(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
// re-order
getAll(cache, asList(0, 1, 2));
CacheTesting.drainRecencyQueues(cache);
- ASSERT.that(keySet).has().allOf(3, 4, 5, 6, 7, 8, 9, 0, 1, 2);
+ ASSERT.that(keySet).hasContentsAnyOrder(3, 4, 5, 6, 7, 8, 9, 0, 1, 2);
// evict 3, 4, 5
getAll(cache, asList(10));
CacheTesting.drainRecencyQueues(cache);
- ASSERT.that(keySet).has().allOf(6, 7, 8, 9, 0, 1, 2, 10);
+ ASSERT.that(keySet).hasContentsAnyOrder(6, 7, 8, 9, 0, 1, 2, 10);
// re-order
getAll(cache, asList(6, 7, 8));
CacheTesting.drainRecencyQueues(cache);
- ASSERT.that(keySet).has().allOf(9, 0, 1, 2, 10, 6, 7, 8);
+ ASSERT.that(keySet).hasContentsAnyOrder(9, 0, 1, 2, 10, 6, 7, 8);
// evict 9, 1, 2, 10
getAll(cache, asList(15));
CacheTesting.drainRecencyQueues(cache);
- ASSERT.that(keySet).has().allOf(0, 6, 7, 8, 15);
+ ASSERT.that(keySet).hasContentsAnyOrder(0, 6, 7, 8, 15);
// fill empty space
getAll(cache, asList(9));
CacheTesting.drainRecencyQueues(cache);
- ASSERT.that(keySet).has().allOf(0, 6, 7, 8, 15, 9);
+ ASSERT.that(keySet).hasContentsAnyOrder(0, 6, 7, 8, 15, 9);
// evict 6
getAll(cache, asList(1));
CacheTesting.drainRecencyQueues(cache);
- ASSERT.that(keySet).has().allOf(0, 7, 8, 15, 9, 1);
+ ASSERT.that(keySet).hasContentsAnyOrder(0, 7, 8, 15, 9, 1);
}
public void testEviction_overweight() {
@@ -245,17 +245,17 @@ public class CacheEvictionTest extends TestCase {
.build(loader);
CacheTesting.warmUp(cache, 0, 10);
Set<Integer> keySet = cache.asMap().keySet();
- ASSERT.that(keySet).has().allOf(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+ ASSERT.that(keySet).hasContentsAnyOrder(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
// add an at-the-maximum-weight entry
getAll(cache, asList(45));
CacheTesting.drainRecencyQueues(cache);
- ASSERT.that(keySet).has().allOf(0, 45);
+ ASSERT.that(keySet).hasContentsAnyOrder(0, 45);
// add an over-the-maximum-weight entry
getAll(cache, asList(46));
CacheTesting.drainRecencyQueues(cache);
- ASSERT.that(keySet).has().item(0);
+ ASSERT.that(keySet).hasContentsAnyOrder(0);
}
public void testEviction_invalidateAll() {
@@ -272,7 +272,7 @@ public class CacheEvictionTest extends TestCase {
// add 0, 1, 2, 3, 4
getAll(cache, asList(0, 1, 2, 3, 4));
CacheTesting.drainRecencyQueues(cache);
- ASSERT.that(keySet).has().allOf(0, 1, 2, 3, 4);
+ ASSERT.that(keySet).hasContentsAnyOrder(0, 1, 2, 3, 4);
// invalidate all
cache.invalidateAll();
@@ -282,7 +282,7 @@ public class CacheEvictionTest extends TestCase {
// add 5, 6, 7, 8, 9, 10, 11, 12
getAll(cache, asList(5, 6, 7, 8, 9, 10, 11, 12));
CacheTesting.drainRecencyQueues(cache);
- ASSERT.that(keySet).has().allOf(5, 6, 7, 8, 9, 10, 11, 12);
+ ASSERT.that(keySet).hasContentsAnyOrder(5, 6, 7, 8, 9, 10, 11, 12);
}
private void getAll(LoadingCache<Integer, Integer> cache, List<Integer> keys) {