{
groupIncreaser++;
CacheSPI<Object, Object> cache = createAsyncReplicatedCache();
CacheSPI<Object, Object> cache2 = createAsyncReplicatedCache();
ReplicationListener replListener2 = new ReplicationListener(cache2);
LockManager lockManager = TestingUtil.extractLockManager(cache);
LockManager lockManager2 = TestingUtil.extractLockManager(cache2);
TransactionManager mgr = cache.getConfiguration().getRuntimeConfig().getTransactionManager();
assertNull(mgr.getTransaction());
mgr.begin();
assertEquals(0, cache.getTransactionTable().getNumGlobalTransactions());
assertEquals(0, cache.getTransactionTable().getNumLocalTransactions());
SamplePojo pojo = new SamplePojo(21, "test");
replListener2.expect(PutKeyValueCommand.class, CommitCommand.class);
cache.put("/one/two", "key1", pojo);
mgr.commit();
replListener2.waitForReplicationToOccur(1000);
// cache asserts
assertNull(mgr.getTransaction());
assertEquals(0, cache.getTransactionTable().getNumGlobalTransactions());
assertEquals(0, cache.getTransactionTable().getNumLocalTransactions());
assertTrue(cache.exists(Fqn.fromString("/one/two")));
assertNotNull(cache.getNode("/one"));
assertNotNull(cache.get(Fqn.fromString("/one/two"), "key1"));
assertTrue(cache.exists(Fqn.fromString("/one/two")));
assertNotNull(cache.getNode("/one"));
assertEquals(false, lockManager.isLocked(cache.getRoot()));
assertEquals(false, lockManager.isLocked(cache.getNode("/one")));
assertEquals(false, lockManager.isLocked(cache.getNode("/one/two")));
assertNotNull(cache.getNode("/one").getChild("two"));
assertNotNull(cache.get(Fqn.fromString("/one/two"), "key1"));
// cache2 asserts
assertEquals(0, cache2.getTransactionTable().getNumGlobalTransactions());
assertEquals(0, cache2.getTransactionTable().getNumLocalTransactions());
assertTrue(cache2.exists(Fqn.fromString("/one/two")));
assertNotNull(cache2.getRoot().getChild("one"));
assertNotNull(cache2.get(Fqn.fromString("/one/two"), "key1"));
assertTrue(cache2.exists(Fqn.fromString("/one/two")));
assertNotNull(cache2.getRoot().getChild("one"));
assertEquals(false, lockManager2.isLocked(cache2.getRoot()));
assertEquals(false, lockManager2.isLocked(cache2.getNode("/one")));
assertEquals(false, lockManager2.isLocked(cache2.getNode("/one/two")));
assertNotNull(cache2.getNode("/one").getChild("two"));
assertNotNull(cache2.get(Fqn.fromString("/one/two"), "key1"));
replListener2.expect(RemoveNodeCommand.class);
replListener2.expect(CommitCommand.class);