jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r427978 - /jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/AbstractJCRTest.java
Date Wed, 02 Aug 2006 13:34:40 GMT
Author: mreutegg
Date: Wed Aug  2 06:34:39 2006
New Revision: 427978

URL: http://svn.apache.org/viewvc?rev=427978&view=rev
Log:
JCR-505: TCK: AbstractJCRTest fails if setUp/tearDown cannot remove children of test node

Modified:
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/AbstractJCRTest.java

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/AbstractJCRTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/AbstractJCRTest.java?rev=427978&r1=427977&r2=427978&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/AbstractJCRTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/AbstractJCRTest.java
Wed Aug  2 06:34:39 2006
@@ -26,6 +26,7 @@
 import javax.jcr.Repository;
 import javax.jcr.NamespaceException;
 import javax.jcr.RangeIterator;
+import javax.jcr.nodetype.NodeDefinition;
 import java.util.StringTokenizer;
 import java.util.Random;
 import java.util.List;
@@ -527,7 +528,11 @@
             // clean test root
             testRootNode = root.getNode(testPath);
             for (NodeIterator children = testRootNode.getNodes(); children.hasNext();) {
-                children.nextNode().remove();
+                Node child = children.nextNode();
+                NodeDefinition nodeDef = child.getDefinition();
+                if (!nodeDef.isMandatory() && !nodeDef.isProtected()) {
+                    child.remove();
+                }
             }
         } else {
             // create nodes to testPath



Mime
View raw message