[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/api ...
Manik Surtani
msurtani at jboss.com
Sat Sep 16 08:03:55 EDT 2006
User: msurtani
Date: 06/09/16 08:03:55
Modified: tests/functional/org/jboss/cache/api NodeMoveAPITest.java
Log:
Revision Changes Path
1.4 +24 -1 JBossCache/tests/functional/org/jboss/cache/api/NodeMoveAPITest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: NodeMoveAPITest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/api/NodeMoveAPITest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- NodeMoveAPITest.java 16 Sep 2006 00:23:35 -0000 1.3
+++ NodeMoveAPITest.java 16 Sep 2006 12:03:55 -0000 1.4
@@ -287,6 +287,28 @@
fail("implement me!");
}
+ public void testLocksDeepMove() throws Exception
+ {
+ nodeA = rootNode.addChild(A);
+ nodeB = nodeA.addChild(B);
+ nodeD = nodeB.addChild(D);
+ nodeC = rootNode.addChild(C);
+ assertEquals(0, ((TreeCacheProxyImpl) rootNode).treeCache.getNumberOfLocksHeld());
+ tm.begin();
+
+ nodeB.move(nodeC);
+// nodeC should have a RL, nodeA should have a RL, nodeB should have a WL, nodeD should have a WL
+
+ System.out.println("LOCKS: " + ((TreeCacheProxyImpl) rootNode).treeCache.printLockInfo());
+
+ assertEquals("nodeC should have a RL, nodeA should have a RL, nodeB should have a WL, nodeD should have a WL", 4, ((TreeCacheProxyImpl) rootNode).treeCache.getNumberOfLocksHeld());
+
+
+ tm.commit();
+
+ assertEquals(0, ((TreeCacheProxyImpl) rootNode).treeCache.getNumberOfLocksHeld());
+ }
+
public void testLocks() throws Exception
{
nodeA = rootNode.addChild(A);
@@ -300,7 +322,7 @@
System.out.println("LOCKS: " + ((TreeCacheProxyImpl) rootNode).treeCache.printLockInfo());
- assertEquals(3, ((TreeCacheProxyImpl) rootNode).treeCache.getNumberOfLocksHeld());
+ assertEquals("nodeC should have a RL, nodeA should have a RL, nodeB should have a WL", 3, ((TreeCacheProxyImpl) rootNode).treeCache.getNumberOfLocksHeld());
tm.commit();
@@ -308,6 +330,7 @@
assertEquals(0, ((TreeCacheProxyImpl) rootNode).treeCache.getNumberOfLocksHeld());
}
+
public void testConcurrency() throws InterruptedException
{
final int N = 3; // number of threads
More information about the jboss-cvs-commits
mailing list