[infinispan-commits] Infinispan SVN: r697 - trunk/core/src/test/java/org/infinispan/distribution.

infinispan-commits at lists.jboss.org infinispan-commits at lists.jboss.org
Mon Aug 17 09:15:47 EDT 2009


Author: manik.surtani at jboss.com
Date: 2009-08-17 09:15:47 -0400 (Mon, 17 Aug 2009)
New Revision: 697

Modified:
   trunk/core/src/test/java/org/infinispan/distribution/BaseDistFunctionalTest.java
   trunk/core/src/test/java/org/infinispan/distribution/DistAsyncTxFuncTest.java
   trunk/core/src/test/java/org/infinispan/distribution/DistSyncTxFuncTest.java
Log:
Updated tests for better debug logging

Modified: trunk/core/src/test/java/org/infinispan/distribution/BaseDistFunctionalTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/distribution/BaseDistFunctionalTest.java	2009-08-14 16:23:39 UTC (rev 696)
+++ trunk/core/src/test/java/org/infinispan/distribution/BaseDistFunctionalTest.java	2009-08-17 13:15:47 UTC (rev 697)
@@ -342,8 +342,8 @@
       @Override
       public String toString() {
          return "MagicKey{" +
-               (name == null ? "" : "name=" + name) +
-               ", hashcode=" + hashcode +
+               (name == null ? "" : "name=" + name + ", ") +
+               "hashcode=" + hashcode +
                ", address='" + address + '\'' +
                '}';
       }

Modified: trunk/core/src/test/java/org/infinispan/distribution/DistAsyncTxFuncTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/distribution/DistAsyncTxFuncTest.java	2009-08-14 16:23:39 UTC (rev 696)
+++ trunk/core/src/test/java/org/infinispan/distribution/DistAsyncTxFuncTest.java	2009-08-17 13:15:47 UTC (rev 697)
@@ -14,6 +14,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.TimeUnit;
 
 @Test(groups = "functional", testName = "distribution.DistAsyncTxFuncTest")
 public class DistAsyncTxFuncTest extends DistSyncTxFuncTest {
@@ -76,14 +77,17 @@
    protected void asyncTxWait(Object... keys) {
       // Wait for a tx completion event
       if (keys != null) {
+
          Set<Cache<?, ?>> cachesInTx = new HashSet<Cache<?, ?>>();
          for (Object k : keys) {
             cachesInTx.addAll(Arrays.asList(getOwners(k)));
          }
 
+         log.warn("In asyncTxWait, waiting for repl events on caches " + cachesInTx + " on keys " + Arrays.toString(keys));
+
          for (Cache<?, ?> c : cachesInTx) {
             listenerLookup.get(c).expectAnyWithTx();
-            listenerLookup.get(c).waitForRpc();
+            listenerLookup.get(c).waitForRpc(240, TimeUnit.SECONDS);
          }
       }
    }

Modified: trunk/core/src/test/java/org/infinispan/distribution/DistSyncTxFuncTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/distribution/DistSyncTxFuncTest.java	2009-08-14 16:23:39 UTC (rev 696)
+++ trunk/core/src/test/java/org/infinispan/distribution/DistSyncTxFuncTest.java	2009-08-17 13:15:47 UTC (rev 697)
@@ -42,8 +42,8 @@
 
    public void testTransactionsSpanningKeysCommit() throws Exception {
 //    we need 2 keys that reside on different caches...
-      MagicKey k1 = new MagicKey(c1); // maps on to c1 and c2
-      MagicKey k2 = new MagicKey(c2); // maps on to c2 and c3
+      MagicKey k1 = new MagicKey(c1, "k1"); // maps on to c1 and c2
+      MagicKey k2 = new MagicKey(c2, "k2"); // maps on to c2 and c3
 
       init(k1, k2);
 
@@ -98,8 +98,8 @@
 
    public void testTransactionsSpanningKeysRollback() throws Exception {
       // we need 2 keys that reside on different caches...
-      MagicKey k1 = new MagicKey(c1); // maps on to c1 and c2
-      MagicKey k2 = new MagicKey(c2); // maps on to c2 and c3
+      MagicKey k1 = new MagicKey(c1, "k1"); // maps on to c1 and c2
+      MagicKey k2 = new MagicKey(c2, "k2"); // maps on to c2 and c3
 
       init(k1, k2);
 
@@ -125,8 +125,8 @@
 
    public void testPutFromNonOwner() throws Exception {
       // we need 2 keys that reside on different caches...
-      MagicKey k1 = new MagicKey(c1); // maps on to c1 and c2
-      MagicKey k2 = new MagicKey(c2); // maps on to c2 and c3
+      MagicKey k1 = new MagicKey(c1, "k1"); // maps on to c1 and c2
+      MagicKey k2 = new MagicKey(c2, "k2"); // maps on to c2 and c3
 
       init(k1, k2);
 
@@ -153,8 +153,8 @@
 
    public void testPutIfAbsentFromNonOwner() throws Exception {
       // we need 2 keys that reside on different caches...
-      MagicKey k1 = new MagicKey(c1); // maps on to c1 and c2
-      MagicKey k2 = new MagicKey(c2); // maps on to c2 and c3
+      MagicKey k1 = new MagicKey(c1, "k1"); // maps on to c1 and c2
+      MagicKey k2 = new MagicKey(c2, "k2"); // maps on to c2 and c3
 
       init(k1, k2);
 
@@ -196,8 +196,8 @@
 
    public void testRemoveFromNonOwner() throws Exception {
       // we need 2 keys that reside on different caches...
-      MagicKey k1 = new MagicKey(c1); // maps on to c1 and c2
-      MagicKey k2 = new MagicKey(c2); // maps on to c2 and c3
+      MagicKey k1 = new MagicKey(c1, "k1"); // maps on to c1 and c2
+      MagicKey k2 = new MagicKey(c2, "k2"); // maps on to c2 and c3
 
       init(k1, k2);
 
@@ -227,8 +227,8 @@
 
    public void testConditionalRemoveFromNonOwner() throws Exception {
       // we need 2 keys that reside on different caches...
-      MagicKey k1 = new MagicKey(c1); // maps on to c1 and c2
-      MagicKey k2 = new MagicKey(c2); // maps on to c2 and c3
+      MagicKey k1 = new MagicKey(c1, "k1"); // maps on to c1 and c2
+      MagicKey k2 = new MagicKey(c2, "k2"); // maps on to c2 and c3
 
       init(k1, k2);
 
@@ -266,8 +266,8 @@
 
    public void testReplaceFromNonOwner() throws Exception {
       // we need 2 keys that reside on different caches...
-      MagicKey k1 = new MagicKey(c1); // maps on to c1 and c2
-      MagicKey k2 = new MagicKey(c2); // maps on to c2 and c3
+      MagicKey k1 = new MagicKey(c1, "k1"); // maps on to c1 and c2
+      MagicKey k2 = new MagicKey(c2, "k2"); // maps on to c2 and c3
 
       init(k1, k2);
 
@@ -297,8 +297,8 @@
 
    public void testConditionalReplaceFromNonOwner() throws Exception {
       // we need 2 keys that reside on different caches...
-      MagicKey k1 = new MagicKey(c1); // maps on to c1 and c2
-      MagicKey k2 = new MagicKey(c2); // maps on to c2 and c3
+      MagicKey k1 = new MagicKey(c1, "k1"); // maps on to c1 and c2
+      MagicKey k2 = new MagicKey(c2, "k2"); // maps on to c2 and c3
 
       init(k1, k2);
 



More information about the infinispan-commits mailing list