}
public void testPreloadWithTwoWayKey2StringMapperAndBoundedCache() throws Exception {
String mapperName = TwoWayPersonKey2StringMapper.class.getName();
ConfigurationBuilder config = createCacheStoreConfig(mapperName, true, true);
config.eviction().strategy(EvictionStrategy.LRU).maxEntries(3);
withCacheManager(new CacheManagerCallable(
TestCacheManagerFactory.createCacheManager(config)) {
@Override
public void call() {
AdvancedCache<Object, Object> cache = cm.getCache().getAdvancedCache();
for (int i = 0; i < 10; i++) {
Person p = new Person("name" + i, "surname" + i, 30);
cache.put(p, "" + i);
}
}
});
withCacheManager(new CacheManagerCallable(
TestCacheManagerFactory.createCacheManager(config)) {
@Override
public void call() {
AdvancedCache<Object, Object> cache = cm.getCache().getAdvancedCache();
assertEquals(3, cache.getDataContainer().size());