Return-Path: Delivered-To: apmail-jackrabbit-commits-archive@www.apache.org Received: (qmail 31133 invoked from network); 11 Nov 2008 08:17:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Nov 2008 08:17:39 -0000 Received: (qmail 62043 invoked by uid 500); 11 Nov 2008 08:17:46 -0000 Delivered-To: apmail-jackrabbit-commits-archive@jackrabbit.apache.org Received: (qmail 61955 invoked by uid 500); 11 Nov 2008 08:17:46 -0000 Mailing-List: contact commits-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list commits@jackrabbit.apache.org Received: (qmail 61946 invoked by uid 99); 11 Nov 2008 08:17:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Nov 2008 00:17:46 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Nov 2008 08:16:35 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id CE42F2388995; Tue, 11 Nov 2008 00:16:48 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@jackrabbit.apache.org From: angela@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081111081648.CE42F2388995@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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