jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1354501 - /jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/AbstractRepositoryTestBase.java
Date Wed, 27 Jun 2012 13:51:12 GMT
Author: ard
Date: Wed Jun 27 13:51:11 2012
New Revision: 1354501

URL: http://svn.apache.org/viewvc?rev=1354501&view=rev
Log:
OCM-47 fix unit test node clean up

Modified:
    jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/AbstractRepositoryTestBase.java

Modified: jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/AbstractRepositoryTestBase.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/AbstractRepositoryTestBase.java?rev=1354501&r1=1354500&r2=1354501&view=diff
==============================================================================
--- jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/AbstractRepositoryTestBase.java
(original)
+++ jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/AbstractRepositoryTestBase.java
Wed Jun 27 13:51:11 2012
@@ -119,7 +119,7 @@ public abstract class AbstractRepository
             while (nodeIterator.hasNext())
             {
                 Node node = nodeIterator.nextNode();
-                if (! node.getName().startsWith("jcr:"))
+                if (! node.getName().startsWith("jcr:") && ! node.getName().startsWith("rep:"))
                 {
                     log.debug("tearDown - remove : " + node.getPath());
                     node.remove();
@@ -218,4 +218,24 @@ public abstract class AbstractRepository
         }
         return false;
     }
+
+
+    /**
+     * utility method to easily print an overview the repository contents
+     * @param node
+     * @param indent
+     * @throws RepositoryException
+     */
+    protected void traverse(final Node node, String indent) throws RepositoryException {
+        if (node.getPath().equals("/jcr:system")) {
+            return;
+        }
+        System.out.println(indent + node.getPath() +  " [ "+  node.getPrimaryNodeType().getName()
+ " ] ");
+        indent = indent + "\t";
+        NodeIterator it = node.getNodes();
+        while (it.hasNext()) {
+            traverse(it.nextNode(), indent);
+        }
+    }
+
 }
\ No newline at end of file



Mime
View raw message