use of com.github.benmanes.caffeine.testing.DescriptionBuilder in project caffeine by ben-manes.
the class IsValidUnboundedLocalCache method matchesSafely.
@Override
protected boolean matchesSafely(UnboundedLocalCache<K, V> map, Description description) {
desc = new DescriptionBuilder(description);
checkMap(map, desc);
return desc.matches();
}
use of com.github.benmanes.caffeine.testing.DescriptionBuilder in project caffeine by ben-manes.
the class IsValidSingleConsumerQueue method matchesSafely.
@Override
protected boolean matchesSafely(SingleConsumerQueue<E> queue, Description description) {
DescriptionBuilder builder = new DescriptionBuilder(description);
if (queue.isEmpty()) {
builder.expectThat("empty queue", queue, is(deeplyEmpty()));
builder.expectThat("empty queue", queue.head, is(queue.tail));
builder.expectThat("empty queue", queue.head.next, is(nullValue()));
}
builder.expectThat("corrupted queue node", queue.tail.next, is(nullValue()));
checkForLoop(queue, builder);
checkArena(queue, builder);
return builder.matches();
}
Aggregations