[ http://issues.apache.org/jira/browse/JCR-506?page=all ]
David Pitfield closed JCR-506. ------------------------------ > TCK: NodeTest fails if setUp/tearDown cannot remove all child nodes of test > node > -------------------------------------------------------------------------------- > > Key: JCR-506 > URL: http://issues.apache.org/jira/browse/JCR-506 > Project: Jackrabbit > Issue Type: Bug > Components: test > Reporter: David Pitfield > > If the test node exists, the setUp and tearDown methods remove all its child > nodes. In some repositories these child nodes may be mandatory or protected, > causing test setup/teardown to fail. > Proposal: tolerate exceptions thrown in removing a child node in test > setup/teardown. > --- NodeTest.java (revision 422074) > +++ NodeTest.java (working copy) > @@ -62,7 +62,13 @@ > // clean test root > Node testNode = root.getNode(testPath); > for (NodeIterator children = testNode.getNodes(); > children.hasNext();) { > - children.nextNode().remove(); > + try { > + children.nextNode().remove(); > + } > + catch (RepositoryException e) { > + // consume > + } > + > } > } else { > StringTokenizer names = new StringTokenizer(testPath, "/"); > @@ -82,7 +88,12 @@ > // delete all children of test root node > Node rootNodeW2 = (Node) > superuserW2.getItem(testRootNode.getPath()); > for (NodeIterator children = rootNodeW2.getNodes(); > children.hasNext();) { > - children.nextNode().remove(); > + try { > + children.nextNode().remove(); > + } > + catch (RepositoryException e) { > + // consume > + } > } > // save changes > superuserW2.save(); -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
