[jboss-cvs] JBossAS SVN: r86552 - trunk/testsuite/src/main/org/jboss/test/cluster/lock.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Mar 31 18:07:35 EDT 2009


Author: bstansberry at jboss.com
Date: 2009-03-31 18:07:34 -0400 (Tue, 31 Mar 2009)
New Revision: 86552

Modified:
   trunk/testsuite/src/main/org/jboss/test/cluster/lock/ClusteredLockManagerTestBase.java
Log:
[JBAS-5552] Fix locking bugs observed during ClusteredDeploymentRepository testing

Modified: trunk/testsuite/src/main/org/jboss/test/cluster/lock/ClusteredLockManagerTestBase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/lock/ClusteredLockManagerTestBase.java	2009-03-31 22:07:19 UTC (rev 86551)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/lock/ClusteredLockManagerTestBase.java	2009-03-31 22:07:34 UTC (rev 86552)
@@ -186,9 +186,7 @@
       
       haPartition.registerRPCHandler(eq("test"), isA(RpcTarget.class));
       haPartition.registerMembershipListener(testee);
-      Vector<ClusterNode> view = new Vector<ClusterNode>();
-      view.add(node1);
-      expect(haPartition.getCurrentView()).andReturn(view);
+      expect(haPartition.getClusterNodes()).andReturn(new ClusterNode[]{node1});
       replay(haPartition);
       
       testee.start();
@@ -302,7 +300,7 @@
       ArrayList<RemoteLockResponse> rspList = new ArrayList<RemoteLockResponse>();
       for (int i = 0; i < viewSize - 1; i++)
       {
-         rspList.add(new RemoteLockResponse(RemoteLockResponse.Flag.OK));
+         rspList.add(new RemoteLockResponse(null, RemoteLockResponse.Flag.OK));
       }
       
       expect(partition.callMethodOnCluster(eq("test"), 
@@ -336,8 +334,8 @@
       ClusterNode superior = testee.getCurrentView().get(0);
       
       ArrayList<RemoteLockResponse> rspList = new ArrayList<RemoteLockResponse>();
-      rspList.add(new RemoteLockResponse(RemoteLockResponse.Flag.OK));
-      rspList.add(new RemoteLockResponse(RemoteLockResponse.Flag.REJECT, superior));
+      rspList.add(new RemoteLockResponse(null, RemoteLockResponse.Flag.OK));
+      rspList.add(new RemoteLockResponse(null, RemoteLockResponse.Flag.REJECT, superior));
       
       
       expect(partition.callMethodOnCluster(eq("test"), 
@@ -369,8 +367,8 @@
       ClusterNode inferior = testee.getCurrentView().get(2);
       
       ArrayList<RemoteLockResponse> rspList = new ArrayList<RemoteLockResponse>();
-      rspList.add(new RemoteLockResponse(RemoteLockResponse.Flag.OK));
-      rspList.add(new RemoteLockResponse(RemoteLockResponse.Flag.REJECT, inferior));
+      rspList.add(new RemoteLockResponse(null, RemoteLockResponse.Flag.OK));
+      rspList.add(new RemoteLockResponse(null, RemoteLockResponse.Flag.REJECT, inferior));
       
       
       expect(partition.callMethodOnCluster(eq("test"), 
@@ -387,8 +385,8 @@
                                            eq(true))).andReturn(rspList);
       
       rspList = new ArrayList<RemoteLockResponse>();
-      rspList.add(new RemoteLockResponse(RemoteLockResponse.Flag.OK));
-      rspList.add(new RemoteLockResponse(RemoteLockResponse.Flag.OK));
+      rspList.add(new RemoteLockResponse(null, RemoteLockResponse.Flag.OK));
+      rspList.add(new RemoteLockResponse(null, RemoteLockResponse.Flag.OK));
       
       expect(partition.callMethodOnCluster(eq("test"), 
                                            eq("remoteLock"), 
@@ -426,8 +424,7 @@
       makeThreadSafe(handler, true);
       
       ArrayList<RemoteLockResponse> rspList = new ArrayList<RemoteLockResponse>();
-      rspList.add(new RemoteLockResponse(RemoteLockResponse.Flag.OK));
-      rspList.add(new RemoteLockResponse(RemoteLockResponse.Flag.OK));
+      rspList.add(new RemoteLockResponse(null, RemoteLockResponse.Flag.OK));
       
       expect(partition.callMethodOnCluster(eq("test"), 
                                            eq("remoteLock"), 
@@ -502,8 +499,8 @@
       CountDownLatch answerStartLatch = new CountDownLatch(1);
       
       ArrayList<RemoteLockResponse> rspList = new ArrayList<RemoteLockResponse>();
-      rspList.add(new RemoteLockResponse(RemoteLockResponse.Flag.OK));
-      rspList.add(new RemoteLockResponse(RemoteLockResponse.Flag.REJECT, superiorCaller));
+      rspList.add(new RemoteLockResponse(null, RemoteLockResponse.Flag.OK));
+      rspList.add(new RemoteLockResponse(null, RemoteLockResponse.Flag.REJECT, superiorCaller));
       
       BlockingAnswer<ArrayList<RemoteLockResponse>> caller1Answer = new BlockingAnswer<ArrayList<RemoteLockResponse>>(rspList, answerAwaitLatch, answerStartLatch, null);
       
@@ -580,8 +577,8 @@
       CountDownLatch answerStartLatch = new CountDownLatch(1);
       
       ArrayList<RemoteLockResponse> rspList = new ArrayList<RemoteLockResponse>();
-      rspList.add(new RemoteLockResponse(RemoteLockResponse.Flag.OK));
-      rspList.add(new RemoteLockResponse(RemoteLockResponse.Flag.REJECT, inferiorCaller));
+      rspList.add(new RemoteLockResponse(null, RemoteLockResponse.Flag.OK));
+      rspList.add(new RemoteLockResponse(null, RemoteLockResponse.Flag.REJECT, inferiorCaller));
       
       BlockingAnswer<ArrayList<RemoteLockResponse>> caller1Answer = new BlockingAnswer<ArrayList<RemoteLockResponse>>(rspList, answerAwaitLatch, answerStartLatch, null);
       
@@ -598,8 +595,8 @@
             eq(true))).andReturn(new ArrayList<Object>()); 
       
       rspList = new ArrayList<RemoteLockResponse>();
-      rspList.add(new RemoteLockResponse(RemoteLockResponse.Flag.OK));
-      rspList.add(new RemoteLockResponse(RemoteLockResponse.Flag.OK));
+      rspList.add(new RemoteLockResponse(null, RemoteLockResponse.Flag.OK));
+      rspList.add(new RemoteLockResponse(null, RemoteLockResponse.Flag.OK));
       
       expect(partition.callMethodOnCluster(eq("test"), 
                                            eq("remoteLock"), 
@@ -665,7 +662,7 @@
       resetToStrict(handler);
       
       ArrayList<RemoteLockResponse> rspList = new ArrayList<RemoteLockResponse>();
-      rspList.add(new RemoteLockResponse(RemoteLockResponse.Flag.OK));
+      rspList.add(new RemoteLockResponse(null, RemoteLockResponse.Flag.OK));
       
       
       expect(partition.callMethodOnCluster(eq("test"), 
@@ -698,7 +695,7 @@
       Capture<RpcTarget>  c = new Capture<RpcTarget>();
       haPartition.registerRPCHandler(eq("test"), and(isA(RpcTarget.class), capture(c)));
       Vector<ClusterNode> view = getView(node, viewPos, viewSize);
-      expect(haPartition.getCurrentView()).andReturn(view);
+      expect(haPartition.getClusterNodes()).andReturn(view.toArray(new ClusterNode[view.size()]));
       
       replay(haPartition);
       replay(handler);      




More information about the jboss-cvs-commits mailing list