use of org.infinispan.eviction.EvictionType in project infinispan by infinispan.
the class BaseStoreFunctionalTest method testReloadWithEviction.
public void testReloadWithEviction() {
int numberOfEntries = 10;
ConfigurationBuilder cb = getDefaultCacheConfiguration();
createCacheStoreConfig(cb.persistence(), "testReloadWithEviction", false).memory().size(numberOfEntries / 2).evictionType(EvictionType.COUNT);
TestingUtil.defineConfiguration(cacheManager, "testReloadWithEviction", cb.build());
Cache<String, Object> cache = cacheManager.getCache("testReloadWithEviction");
Map<String, Object> entriesMap = IntStream.range(0, numberOfEntries).boxed().collect(Collectors.toMap(Object::toString, i -> wrap(i.toString(), "Val" + i)));
cache.putAll(entriesMap);
assertEquals(numberOfEntries, cache.size());
entriesMap.forEach((k, v) -> assertEquals(v, cache.get(k)));
cache.stop();
cache.start();
assertEquals(numberOfEntries, cache.size());
entriesMap.forEach((k, v) -> assertEquals(v, cache.get(k)));
}
Aggregations