@BeforeMethod
protected void setUp() throws Exception {
ConfigurationBuilder configurationBuilder = TestCacheManagerFactory.getDefaultCacheConfiguration(true);
configurationBuilder.transaction().invocationBatching().enable()
.clustering().cacheMode(CacheMode.DIST_SYNC)
.clustering().hash().numOwners(1)
.clustering().stateTransfer().fetchInMemoryState(false);
manager1 = TestCacheManagerFactory.createClusteredCacheManager(configurationBuilder);
manager1.defineConfiguration("test", configurationBuilder.build());
cache1 = manager1.getCache("test").getAdvancedCache();
ex1 = Executors.newSingleThreadExecutor(getTestThreadFactory("KeyGenerator1"));
keyAffinityService1 = KeyAffinityServiceFactory.newLocalKeyAffinityService(cache1, new RndKeyGenerator(), ex1, KEY_QUEUE_SIZE);
log.trace("Address for manager1: " + manager1.getAddress());
manager2 = TestCacheManagerFactory.createClusteredCacheManager(configurationBuilder);
manager2.defineConfiguration("test", configurationBuilder.build());
cache2 = manager2.getCache("test").getAdvancedCache();
ex2 = Executors.newSingleThreadExecutor(getTestThreadFactory("KeyGenerator2"));
keyAffinityService2 = KeyAffinityServiceFactory.newLocalKeyAffinityService(cache2, new RndKeyGenerator(), ex2, KEY_QUEUE_SIZE);
log.trace("Address for manager2: " + manager2.getAddress());
TestingUtil.blockUntilViewsReceived(60000, cache1, cache2);
Thread.sleep(5000);
}