jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r164010 - /incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/lock/LockTest.java
Date Thu, 21 Apr 2005 08:01:50 GMT
Author: mreutegg
Date: Thu Apr 21 01:01:46 2005
New Revision: 164010

URL: http://svn.apache.org/viewcvs?rev=164010&view=rev
Log:
Add test case for Lock.isSessionScoped(), contributed by Vinzenz Wyser.

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

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/lock/LockTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/lock/LockTest.java?rev=164010&r1=164009&r2=164010&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/lock/LockTest.java
(original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/lock/LockTest.java
Thu Apr 21 01:01:46 2005
@@ -334,6 +334,32 @@
     }
 
     /**
+     * Test Lock.isSessionScoped()
+     */
+    public void testIsSessionScoped() throws RepositoryException {
+        // create two lockable nodes
+        Node n1 = testRootNode.addNode(nodeName1, testNodeType);
+        n1.addMixin(mixLockable);
+        Node n2 = testRootNode.addNode(nodeName2, testNodeType);
+        n2.addMixin(mixLockable);
+        testRootNode.save();
+
+        // lock node 1 session-scoped
+        Lock lock1 = n1.lock(false, true);
+        assertTrue("Lock.isSessionScoped() must be true if the lock " +
+                "is session-scoped",
+                lock1.isSessionScoped());
+
+        // lock node 2 open-scoped
+        Lock lock2 = n2.lock(false, false);
+        assertFalse("Lock.isSessionScoped() must be false if the lock " +
+                "is open-scoped",
+                lock2.isSessionScoped());
+
+        n2.unlock();
+    }
+
+    /**
      * Test locks are released when session logs out
      */
     public void testLogout() throws Exception {



Mime
View raw message