[infinispan-commits] Infinispan SVN: r319 - trunk/core/src/test/java/org/infinispan/replication.
infinispan-commits at lists.jboss.org
infinispan-commits at lists.jboss.org
Mon May 18 05:47:25 EDT 2009
Author: vblagojevic at jboss.com
Date: 2009-05-18 05:47:25 -0400 (Mon, 18 May 2009)
New Revision: 319
Modified:
trunk/core/src/test/java/org/infinispan/replication/SyncReplLockingTest.java
Log:
test both commit and rollback
Modified: trunk/core/src/test/java/org/infinispan/replication/SyncReplLockingTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/replication/SyncReplLockingTest.java 2009-05-18 09:41:00 UTC (rev 318)
+++ trunk/core/src/test/java/org/infinispan/replication/SyncReplLockingTest.java 2009-05-18 09:47:25 UTC (rev 319)
@@ -67,8 +67,10 @@
}
public void testLocksReleasedWithoutExplicitUnlock() throws Exception {
- locksReleasedWithoutExplicitUnlockHelper(false);
- locksReleasedWithoutExplicitUnlockHelper(true);
+ locksReleasedWithoutExplicitUnlockHelper(false,false);
+ locksReleasedWithoutExplicitUnlockHelper(true,false);
+ locksReleasedWithoutExplicitUnlockHelper(false,true);
+ locksReleasedWithoutExplicitUnlockHelper(true,true);
}
public void testConcurrentNonTxLocking() throws Exception {
@@ -166,7 +168,8 @@
assert cache2.isEmpty();
}
- private void locksReleasedWithoutExplicitUnlockHelper(boolean lockPriorToPut) throws Exception {
+ private void locksReleasedWithoutExplicitUnlockHelper(boolean lockPriorToPut, boolean useCommit)
+ throws Exception {
assertClusterSize("Should only be 2 caches in the cluster!!!", 2);
assertNull("Should be null", cache1.get(k));
@@ -180,11 +183,20 @@
cache1.put(k, name);
if (!lockPriorToPut)
cache1.getAdvancedCache().lock(k);
- mgr.commit();
- assertEquals(name, cache1.get(k));
- assertEquals("Should have replicated", name, cache2.get(k));
+ if (useCommit)
+ mgr.commit();
+ else
+ mgr.rollback();
+ if (useCommit) {
+ assertEquals(name, cache1.get(k));
+ assertEquals("Should have replicated", name, cache2.get(k));
+ } else {
+ assertEquals(null, cache1.get(k));
+ assertEquals("Should not have replicated", null, cache2.get(k));
+ }
+
cache2.remove(k);
assert cache1.isEmpty();
assert cache2.isEmpty();
More information about the infinispan-commits
mailing list