jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r712985 - in /jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/lock: AbstractLockTest.java DeepLockTest.java
Date Tue, 11 Nov 2008 08:16:48 GMT
Author: angela
Date: Tue Nov 11 00:16:48 2008
New Revision: 712985

URL: http://svn.apache.org/viewvc?rev=712985&view=rev
Log:
more lock test cases

Modified:
    jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/lock/AbstractLockTest.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/lock/DeepLockTest.java

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/lock/AbstractLockTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/lock/AbstractLockTest.java?rev=712985&r1=712984&r2=712985&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/lock/AbstractLockTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/lock/AbstractLockTest.java
Tue Nov 11 00:16:48 2008
@@ -333,4 +333,13 @@
         // lock token not present within tokens returned by Session.getLockTokens.
         fail("Upon successful call to Node.lock, the lock token must automatically be added
to the set of tokens held by the Session.");
     }
+
+    public void testRemoveLockedNode() throws RepositoryException {
+        Node n = (Node) otherSession.getItem(lockedNode.getPath());
+
+        // since removing a node is a modification of the non-locked parent
+        // the removal must succeed.
+        n.remove();
+        otherSession.save();
+    }
 }
\ No newline at end of file

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/lock/DeepLockTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/lock/DeepLockTest.java?rev=712985&r1=712984&r2=712985&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/lock/DeepLockTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/lock/DeepLockTest.java
Tue Nov 11 00:16:48 2008
@@ -23,6 +23,7 @@
 
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
+import javax.jcr.Session;
 import javax.jcr.lock.Lock;
 import javax.jcr.lock.LockException;
 
@@ -142,4 +143,18 @@
             // expected
         }
     }
+
+    public void testRemoveLockedChild() throws RepositoryException {
+        Session otherSession = helper.getReadWriteSession();
+        try {
+            Node child = (Node) otherSession.getItem(childNode.getPath());
+            child.remove();
+            otherSession.save();
+            fail("A node below a deeply locked node cannot be removed by another Session.");
+        } catch (LockException e) {
+            // success
+        } finally {
+            otherSession.logout();
+        }
+    }
 }
\ No newline at end of file



Mime
View raw message