use of org.apache.geode.internal.cache.lru.HeapEvictor in project geode by apache.
the class GemFireCacheImplTest method checkEvictorsClosed.
@Test
public void checkEvictorsClosed() {
InternalDistributedSystem ds = Fakes.distributedSystem();
CacheConfig cc = new CacheConfig();
TypeRegistry typeRegistry = mock(TypeRegistry.class);
SystemTimer ccpTimer = mock(SystemTimer.class);
HeapEvictor he = mock(HeapEvictor.class);
OffHeapEvictor ohe = mock(OffHeapEvictor.class);
GemFireCacheImpl gfc = GemFireCacheImpl.createWithAsyncEventListeners(ds, cc, typeRegistry);
try {
gfc.setHeapEvictor(he);
gfc.setOffHeapEvictor(ohe);
} finally {
gfc.close();
}
verify(he, times(1)).close();
verify(ohe, times(1)).close();
}
Aggregations