assert TestingUtil.extractComponent(transactional, Transport.class) != null;
assert TestingUtil.extractComponent(c, Transport.class) == TestingUtil.extractComponent(transactional, Transport.class);
}
public void testForceUnsharedComponents() {
Configuration defaultCfg = new Configuration();
defaultCfg.setFetchInMemoryState(false);
defaultCfg.setCacheMode(Configuration.CacheMode.REPL_SYNC);
defaultCfg.setEvictionStrategy(EvictionStrategy.NONE);
// cache manager with default configuration
cm = TestCacheManagerFactory.createCacheManager(GlobalConfiguration.getClusteredDefault(), defaultCfg);
// default cache with no overrides
Cache c = cm.getCache();
Configuration overrides = new Configuration();
overrides.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
cm.defineConfiguration("transactional", overrides);
Cache transactional = cm.getCache("transactional");
// assert components.
assert TestingUtil.extractComponent(c, EvictionManager.class) != null;