use of org.teiid.common.buffer.BaseCacheEntry in project teiid by teiid.
the class TestLrfuEvictionQueue method testTouch.
@Test
public void testTouch() {
AtomicLong clock = new AtomicLong();
LrfuEvictionQueue<BaseCacheEntry> q = new LrfuEvictionQueue<BaseCacheEntry>(clock);
CacheKey key = new CacheKey(0l, 0l, 0l);
BaseCacheEntry value = new BaseCacheEntry(key);
q.touch(value);
assertEquals(1, q.getSize());
assertNotNull(q.firstEntry(true));
// advance the clock to perform the remove/add
clock.set(LrfuEvictionQueue.MIN_INTERVAL);
q.touch(value);
assertEquals(1, q.getSize());
assertNotNull(q.firstEntry(true));
}
Aggregations