jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r157937 - incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/NodeTest.java
Date Thu, 17 Mar 2005 15:36:27 GMT
Author: mreutegg
Date: Thu Mar 17 07:36:27 2005
New Revision: 157937

URL: http://svn.apache.org/viewcvs?view=rev&rev=157937
Log:
Fixed locking test cases.

Modified:
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/NodeTest.java

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/NodeTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/NodeTest.java?view=diff&r1=157936&r2=157937
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/NodeTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/NodeTest.java Thu Mar
17 07:36:27 2005
@@ -649,11 +649,18 @@
         }
         testRootNode.save();
 
-        node.lock(true, true);
+        // remove first slash of path to get rel path to root
+        String pathRelToRoot = node.getPath().substring(1);
+
+        // access node through another session to lock it
+        Session session2 = helper.getSuperuserSession();
+        Node node2 = session2.getRootNode().getNode(pathRelToRoot);
+        node2.lock(true, true);
 
         // test fails if a LockException is thrown when removing the node
         // (remove must be possible since the parent is not locked)
         node.remove();
+        session2.logout();
     }
 
     /**
@@ -689,7 +696,13 @@
         Node subNode = node.addNode(nodeName2, testNodeType);
         testRootNode.save();
 
-        node.lock(true, true);
+        // lock the node
+        // remove first slash of path to get rel path to root
+        String pathRelToRoot = node.getPath().substring(1);
+        // access node through another session to lock it
+        Session session2 = helper.getSuperuserSession();
+        Node node2 = session2.getRootNode().getNode(pathRelToRoot);
+        node2.lock(true, true);
 
         try {
             subNode.remove();
@@ -700,7 +713,8 @@
         }
 
         // unlock to remove node at tearDown()
-        node.unlock();
+        node2.unlock();
+        session2.logout();
     }
 
     /**



Mime
View raw message