Search in sources :

Example 1 with HeapEvictor

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();
}
Also used : OffHeapEvictor(org.apache.geode.internal.cache.lru.OffHeapEvictor) InternalDistributedSystem(org.apache.geode.distributed.internal.InternalDistributedSystem) TypeRegistry(org.apache.geode.pdx.internal.TypeRegistry) HeapEvictor(org.apache.geode.internal.cache.lru.HeapEvictor) OffHeapEvictor(org.apache.geode.internal.cache.lru.OffHeapEvictor) SystemTimer(org.apache.geode.internal.SystemTimer) Test(org.junit.Test) UnitTest(org.apache.geode.test.junit.categories.UnitTest)

Aggregations

InternalDistributedSystem (org.apache.geode.distributed.internal.InternalDistributedSystem)1 SystemTimer (org.apache.geode.internal.SystemTimer)1 HeapEvictor (org.apache.geode.internal.cache.lru.HeapEvictor)1 OffHeapEvictor (org.apache.geode.internal.cache.lru.OffHeapEvictor)1 TypeRegistry (org.apache.geode.pdx.internal.TypeRegistry)1 UnitTest (org.apache.geode.test.junit.categories.UnitTest)1 Test (org.junit.Test)1