[infinispan-commits] Infinispan SVN: r2376 - branches/4.2.x/core/src/test/java/org/infinispan/tx/dld.

infinispan-commits at lists.jboss.org infinispan-commits at lists.jboss.org
Wed Sep 15 09:31:26 EDT 2010


Author: mircea.markus
Date: 2010-09-15 09:31:26 -0400 (Wed, 15 Sep 2010)
New Revision: 2376

Modified:
   branches/4.2.x/core/src/test/java/org/infinispan/tx/dld/BaseDldLazyLockingTest.java
   branches/4.2.x/core/src/test/java/org/infinispan/tx/dld/DldLazyLockingReplicationTest.java
Log:
[ISPN-631] - DLD and dist tests are disabled - enable and enhance these tests
- more DLD tests

Modified: branches/4.2.x/core/src/test/java/org/infinispan/tx/dld/BaseDldLazyLockingTest.java
===================================================================
--- branches/4.2.x/core/src/test/java/org/infinispan/tx/dld/BaseDldLazyLockingTest.java	2010-09-15 13:02:27 UTC (rev 2375)
+++ branches/4.2.x/core/src/test/java/org/infinispan/tx/dld/BaseDldLazyLockingTest.java	2010-09-15 13:31:26 UTC (rev 2376)
@@ -100,15 +100,26 @@
       t0.setKeyValue(k1, "k1_0");
       t0.executeNoResponse(PerCacheExecutorThread.Operations.PUT_KEY_VALUE);
 
-      log.info("---Before commit");
-      t0.executeNoResponse(PerCacheExecutorThread.Operations.COMMIT_TX);
-
       Object t0Response = t0.waitForResponse();
       Object t1Response = t1.waitForResponse();
 
-      boolean v1 = t0Response instanceof Exception;
-      boolean v2 = t1Response instanceof Exception;
-      assert xor(v1, v2) : "both exceptions? " + (v1 && v2);
+      boolean v0 = t0Response instanceof Exception;
+      boolean v1 = t1Response instanceof Exception;
+      assert xor(v0, v1) : "both exceptions? " + (v0 && v1);
 
+      if (!v1) {
+         System.out.println("V0" );
+         assertEquals(cache(0).get(k0), "k0_1");
+         assertEquals(cache(0).get(k1), "k1_1");
+         assertEquals(cache(1).get(k0), "k0_1");
+         assertEquals(cache(1).get(k1), "k1_1");
+      } else {
+         System.out.println("v1 = " + v1);
+         assertEquals(t0.execute(PerCacheExecutorThread.Operations.COMMIT_TX), PerCacheExecutorThread.OperationsResult.COMMIT_TX_OK);
+         assertEquals(cache(0).get(k0), "k0_0");
+         assertEquals(cache(0).get(k1), "k1_0");
+         assertEquals(cache(1).get(k0), "k0_0");
+         assertEquals(cache(1).get(k1), "k1_0");
+      }
    }
 }

Modified: branches/4.2.x/core/src/test/java/org/infinispan/tx/dld/DldLazyLockingReplicationTest.java
===================================================================
--- branches/4.2.x/core/src/test/java/org/infinispan/tx/dld/DldLazyLockingReplicationTest.java	2010-09-15 13:02:27 UTC (rev 2375)
+++ branches/4.2.x/core/src/test/java/org/infinispan/tx/dld/DldLazyLockingReplicationTest.java	2010-09-15 13:31:26 UTC (rev 2376)
@@ -83,7 +83,7 @@
 
    public void testLocalVsRemoteDeadlock() {
       replicationLatch.countDown();
-//      testLocalVsRemoteDeadlock("k0", "k1");
+      testLocalVsRemoteDeadlock("k0", "k1");
    }
 
    public void testExpectedInnerStructure() {



More information about the infinispan-commits mailing list