Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 62953 invoked from network); 13 Oct 2008 19:23:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Oct 2008 19:23:40 -0000 Received: (qmail 41863 invoked by uid 500); 13 Oct 2008 19:23:39 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 41838 invoked by uid 500); 13 Oct 2008 19:23:39 -0000 Mailing-List: contact dev-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 dev@jackrabbit.apache.org Received: (qmail 41827 invoked by uid 99); 13 Oct 2008 19:23:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Oct 2008 12:23:39 -0700 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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Oct 2008 19:22:39 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 34995234C219 for ; Mon, 13 Oct 2008 12:22:46 -0700 (PDT) Message-ID: <1712403302.1223925766214.JavaMail.jira@brutus> Date: Mon, 13 Oct 2008 12:22:46 -0700 (PDT) From: "Brian Whipple (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Updated: (JCR-1807) Removing peer nodes throws RepositoryException In-Reply-To: <1956906251.1223925524231.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JCR-1807?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Brian Whipple updated JCR-1807: ------------------------------- Attachment: TestAll.java RemoveNodeTest.java This new unit test can be used to reproduce the problem. > Removing peer nodes throws RepositoryException > ---------------------------------------------- > > Key: JCR-1807 > URL: https://issues.apache.org/jira/browse/JCR-1807 > Project: Jackrabbit > Issue Type: Bug > Components: jackrabbit-core > Affects Versions: core 1.4.6 > Reporter: Brian Whipple > Attachments: RemoveNodeTest.java, TestAll.java > > > The following UnitTest will reproduce the error. Note that 3 peer nodes must be removed to produce the exception. Additional testing shows that the paths are corrupted after the second remove. > Also note that Node.getPath (per the comment in the test) must be invoked to produce the path corruption. > This unit test is based on the jackrabbit-jcr-tests test framework. I will attach the java file too. Here is the test: > package org.apache.jackrabbit.test.api; > import javax.jcr.Node; > import javax.jcr.NodeIterator; > import javax.jcr.RepositoryException; > import org.apache.jackrabbit.test.AbstractJCRTest; > /** > * RemoveNodeTest contains the test cases for the method > * Node.remove(). > * > * @test > * @sources RemoveNodeTest.java > * @executeClass org.apache.jackrabbit.test.api.RemoveNodeTest > * @keywords level2 > */ > public class RemoveNodeTest extends AbstractJCRTest > { > private static final String CHILD_NAME = "child"; > public void testAddThenRemovePeerNodes() throws Exception > { > // Must remove at least three peers so need to add three peer nodes > long NUM_SIB_NODES = 3; > for (long i = 0; i < NUM_SIB_NODES; i++) > { > testRootNode.addNode(CHILD_NAME); > } > // If this method is not invoked the test will pass > // Getting the child node paths contributes to the error > getPaths(); > // Remove all nodes > removeNodes(); > testRootNode.save(); > // Validate that all nodes have been removed. > long numChildren = testRootNode.getNodes(CHILD_NAME).getSize(); > assertEquals("Invalid number of child nodes", 0, numChildren); > } > private void getPaths() throws RepositoryException > { > NodeIterator childNodes = testRootNode.getNodes(CHILD_NAME); > while (childNodes.hasNext()) > { > Node child = childNodes.nextNode(); > child.getPath(); > } > } > private void removeNodes() throws RepositoryException > { > NodeIterator childNodes = testRootNode.getNodes(CHILD_NAME); > while (childNodes.hasNext()) > { > Node child = childNodes.nextNode(); > child.remove(); > } > } > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.