public void testPreloadStoredAsBinary() {
ConfigurationBuilder cb = TestCacheManagerFactory.getDefaultCacheConfiguration(false);
createCacheStoreConfig(cb.persistence(), true).memory().storageType(StorageType.BINARY);
cacheManager.defineConfiguration("testPreloadStoredAsBinary", cb.build());
Cache<String, Pojo> cache = cacheManager.getCache("testPreloadStoredAsBinary");
cache.start();
assert cache.getCacheConfiguration().persistence().preload();
assertEquals(StorageType.BINARY, cache.getCacheConfiguration().memory().storageType());
cache.put("k1", new Pojo(1));
cache.put("k2", new Pojo(2), 111111, TimeUnit.MILLISECONDS);
cache.put("k3", new Pojo(3), -1, TimeUnit.MILLISECONDS, 222222, TimeUnit.MILLISECONDS);
cache.put("k4", new Pojo(4), 333333, TimeUnit.MILLISECONDS, 444444, TimeUnit.MILLISECONDS);
cache.stop();
cache.start();
assertEquals(4, cache.entrySet().size());
assertEquals(new Pojo(1), cache.get("k1"));
assertEquals(new Pojo(2), cache.get("k2"));
assertEquals(new Pojo(3), cache.get("k3"));
assertEquals(new Pojo(4), cache.get("k4"));
}