assertEquals("value", cache1.get(fqn, "key"));
assertNull("Should NOT have replicated!", cache2.getNode(fqn));
// now make sure cache2 is in sync with cache1:
// make sure this is in a tx
TransactionManager txm = cache2.getTransactionManager();
assertEquals("value", cache1.get(fqn, "key"));
txm.begin();
cache2.put(fqn, "key", "value");
assertEquals("value", cache2.get(fqn, "key"));
txm.commit();
// since the node already exists even PL will not remove it - but will invalidate it's data
Node n = cache1.getNode(fqn);
CacheLoaderInvalidationTest.assertHasBeenInvalidated(n, "Should have been invalidated");
assertEquals("value", cache2.get(fqn, "key"));
// now test the invalidation again
txm = cache1.getTransactionManager();
assertEquals("value", cache2.get(fqn, "key"));
txm.begin();
cache1.put(fqn, "key2", "value2");
assertEquals("value2", cache1.get(fqn, "key2"));
txm.commit();
assertEquals("value2", cache1.get(fqn, "key2"));
// since the node already exists even PL will not remove it - but will invalidate it's data
n = cache2.getNode(fqn);
CacheLoaderInvalidationTest.assertHasBeenInvalidated(n, "Should have been invalidated");
// test a rollback
txm = cache2.getTransactionManager();
assertEquals("value2", cache1.get(fqn, "key2"));
txm.begin();
cache2.put(fqn, "key", "value");
assertEquals("value", cache2.get(fqn, "key"));
txm.rollback();
assertEquals("value2", cache1.get(fqn, "key2"));
n = cache2.getNode(fqn);
CacheLoaderInvalidationTest.assertHasBeenInvalidated(n, "Should have been invalidated");
}