@BeforeClass public void setUp() { // create cache configuration ConfigurationBuilder cb = new ConfigurationBuilder(); cb.clustering().invocationBatching().enable() .clustering().cacheMode(CacheMode.DIST_SYNC) .clustering().stateTransfer().timeout(10000) .locking().lockAcquisitionTimeout(TestingUtil.shortTimeoutMillis()) .locking().isolationLevel(IsolationLevel.REPEATABLE_READ); configuration = cb.build(); mockExecutorService = mock(ExecutorService.class); cache = mock(Cache.class); when(cache.getName()).thenReturn("testCache"); rpcManager = mock(RpcManager.class); commandsFactory = mock(CommandsFactory.class); cacheNotifier = mock(ClusterCacheNotifier.class); persistenceManager = mock(PersistenceManager.class); dataContainer = mock(InternalDataContainer.class); transactionTable = mock(TransactionTable.class); stateTransferLock = mock(StateTransferLock.class); distributionManager = mock(DistributionManager.class); ef = mock(InternalEntryFactory.class); when(distributionManager.getCacheTopology()).thenAnswer(invocation -> cacheTopology); }
.clustering().stateTransfer().timeout(10000) .locking().lockAcquisitionTimeout(TestingUtil.shortTimeoutMillis()) .locking().isolationLevel(IsolationLevel.REPEATABLE_READ);
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder c = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); c.transaction() .transactionMode(TransactionMode.TRANSACTIONAL) .lockingMode(LockingMode.PESSIMISTIC) .locking().isolationLevel(IsolationLevel.REPEATABLE_READ) .locking().lockAcquisitionTimeout(TestingUtil.shortTimeoutMillis()); c.clustering().hash().numOwners(1).groups().enabled(); createClusteredCaches(2, "atomic", c); } }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder c = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, true); c.clustering().hash().numSegments(60).groups().enabled(); c.transaction() .transactionMode(TransactionMode.TRANSACTIONAL) .lockingMode(LockingMode.PESSIMISTIC) .locking().isolationLevel(IsolationLevel.REPEATABLE_READ) .locking().lockAcquisitionTimeout(TestingUtil.shortTimeoutMillis()); createClusteredCaches(2, "atomic", c); } }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder c = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); c.transaction() .transactionMode(TransactionMode.TRANSACTIONAL) .lockingMode(LockingMode.PESSIMISTIC) .locking().isolationLevel(IsolationLevel.REPEATABLE_READ) .locking().lockAcquisitionTimeout(TestingUtil.shortTimeoutMillis()); c.clustering().hash().numOwners(1).groups().enabled(); createClusteredCaches(2, "atomic", c); } }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder c = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, true); c.clustering().hash().numSegments(60).groups().enabled(); c.transaction() .transactionMode(TransactionMode.TRANSACTIONAL) .lockingMode(LockingMode.PESSIMISTIC) .locking().isolationLevel(IsolationLevel.REPEATABLE_READ) .locking().lockAcquisitionTimeout(TestingUtil.shortTimeoutMillis()); createClusteredCaches(2, "atomic", c); } }