jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r157966 - incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/lock/LockTest.java
Date Thu, 17 Mar 2005 19:23:29 GMT
Author: mreutegg
Date: Thu Mar 17 11:23:27 2005
New Revision: 157966

URL: http://svn.apache.org/viewcvs?view=rev&rev=157966
Log:
Test case for Node.unlock()

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?view=diff&r1=157965&r2=157966
==============================================================================
--- 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 Mar 17 11:23:27 2005
@@ -17,9 +17,11 @@
 package org.apache.jackrabbit.test.api.lock;
 
 import org.apache.jackrabbit.test.AbstractJCRTest;
+import org.apache.jackrabbit.test.NotExecutableException;
 
 import javax.jcr.Node;
 import javax.jcr.Session;
+import javax.jcr.Repository;
 import javax.jcr.lock.LockException;
 import javax.jcr.lock.Lock;
 
@@ -424,6 +426,30 @@
 
         // lock holding node must be parent
         assertTrue("lock holding node must be parent", lock.getNode().equals(n1));
+    }
+
+    /**
+     * Tests if a locked, checked-in node can be unlocked
+     */
+    public void testCheckedInUnlock() throws Exception {
+        if (superuser.getRepository().getDescriptor(Repository.OPTION_VERSIONING_SUPPORTED)
== null) {
+            throw new NotExecutableException("Repository does not support versioning.");
+        }
+
+        // set up versionable and lockable node
+        Node testNode = testRootNode.addNode(nodeName1);
+        testNode.addMixin(mixVersionable);
+        testNode.addMixin(mixLockable);
+        testRootNode.save();
+
+        // lock and check-in
+        testNode.lock(false, true);
+        testNode.save();
+        testNode.checkin();
+
+        // do the unlock
+        testNode.unlock();
+        assertFalse("Could not unlock a locked, checked-in node", testNode.holdsLock());
     }
 
     /**



Mime
View raw message