@Override protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder cfg = new ConfigurationBuilder(); cfg.memory().size(CACHE_SIZE).evictionType(EvictionType.COUNT).storageType(StorageType.BINARY) .expiration().wakeUpInterval(100L) .locking().useLockStriping(false) // to minimise chances of deadlock in the unit test .build(); cacheManager = TestCacheManagerFactory.createCacheManager(cfg); cache = cacheManager.getCache(); return cacheManager; }
protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder cfgBuilder = new ConfigurationBuilder(); cfgBuilder.memory().size(128) // 128 max entries .expiration().wakeUpInterval(100L) .locking().useLockStriping(false) // to minimize chances of deadlock in the unit test .invocationBatching().enable(true); EmbeddedCacheManager cm = TestCacheManagerFactory.createCacheManager(cfgBuilder); cache = cm.getCache(); cache.addListener(new EvictionFunctionalTest.EvictionListener()); return cm; }
protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder builder = TestCacheManagerFactory.getDefaultCacheConfiguration(false); builder.memory().size(CACHE_SIZE).storageType(getStorageType()) .expiration().wakeUpInterval(100L).locking() .useLockStriping(false) // to minimize chances of deadlock in the unit test .invocationBatching(); EmbeddedCacheManager cm = TestCacheManagerFactory.createCacheManager(builder); cache = cm.getCache(); evictionListener = new EvictionListener(); cache.addListener(evictionListener); TestingUtil.replaceComponent(cm, TimeService.class, timeService = new ControlledTimeService(), true); return cm; }