@Override protected AdvancedLoadWriteStore createStore() throws Exception { ConfigurationBuilder localBuilder = TestCacheManagerFactory.getDefaultCacheConfiguration(false); localBuilder.memory().evictionType(EvictionType.COUNT).size(WRITE_DELETE_BATCH_MAX_ENTRIES).expiration().wakeUpInterval(10L); // Set it to dist so it has segments localBuilder.clustering().cacheMode(CacheMode.DIST_SYNC); GlobalConfigurationBuilder globalConfig = new GlobalConfigurationBuilder().clusteredDefault(); globalConfig.globalJmxStatistics().defaultCacheName(REMOTE_CACHE); localCacheManager = TestCacheManagerFactory.createClusteredCacheManager( globalConfig, hotRodCacheConfiguration(localBuilder)); localCacheManager.getCache(REMOTE_CACHE); TestingUtil.replaceComponent(localCacheManager, TimeService.class, timeService, true); localCacheManager.getCache(REMOTE_CACHE).getAdvancedCache().getComponentRegistry().rewire(); hrServer = HotRodClientTestingUtil.startHotRodServer(localCacheManager); // In case if the server has to unmarshall the value, make sure to use the same marshaller hrServer.setMarshaller(getMarshaller()); ConfigurationBuilder builder = TestCacheManagerFactory .getDefaultCacheConfiguration(false); RemoteStoreConfigurationBuilder storeConfigurationBuilder = builder .persistence() .addStore(RemoteStoreConfigurationBuilder.class) .remoteCacheName(REMOTE_CACHE); storeConfigurationBuilder .addServer() .host(hrServer.getHost()) .port(hrServer.getPort()); RemoteStore remoteStore = new RemoteStore(); remoteStore.init(createContext(builder.build())); return remoteStore; }