Search in sources :

Example 1 with JCacheStatisticsMXBean

use of com.github.benmanes.caffeine.jcache.management.JCacheStatisticsMXBean in project caffeine by ben-manes.

the class JCacheEvictionListenerTest method before.

@BeforeMethod
public void before() {
    MockitoAnnotations.initMocks(this);
    statistics = new JCacheStatisticsMXBean();
    EventDispatcher<Integer, Integer> dispatcher = new EventDispatcher<>(MoreExecutors.directExecutor());
    listener = new JCacheEvictionListener<>(dispatcher, statistics);
    listener.setCache(cache);
    statistics.enable(true);
    dispatcher.register(new MutableCacheEntryListenerConfiguration<Integer, Integer>(() -> entryListener, null, false, false));
}
Also used : JCacheStatisticsMXBean(com.github.benmanes.caffeine.jcache.management.JCacheStatisticsMXBean) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

JCacheStatisticsMXBean (com.github.benmanes.caffeine.jcache.management.JCacheStatisticsMXBean)1 BeforeMethod (org.testng.annotations.BeforeMethod)1