jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1443375 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/core/ test/java/org/apache/jackrabbit/oak/core/
Date Thu, 07 Feb 2013 09:49:56 GMT
Author: mduerig
Date: Thu Feb  7 09:49:55 2013
New Revision: 1443375

URL: http://svn.apache.org/viewvc?rev=1443375&view=rev
Log:
OAK-568: Duplicated code in TreeLocation implementations

Added:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractTreeLocation.java
      - copied, changed from r1443368, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/NullLocation.java
Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractNodeLocation.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractPropertyLocation.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/NullLocation.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ReadOnlyTree.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/TreeLocationTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractNodeLocation.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractNodeLocation.java?rev=1443375&r1=1443374&r2=1443375&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractNodeLocation.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractNodeLocation.java
Thu Feb  7 09:49:55 2013
@@ -20,20 +20,68 @@ import org.apache.jackrabbit.oak.api.Pro
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.api.Tree.Status;
 import org.apache.jackrabbit.oak.api.TreeLocation;
+import org.apache.jackrabbit.oak.commons.PathUtils;
 
+import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkNotNull;
 
 /**
  * AbstractNodeLocation... TODO
  */
-abstract class AbstractNodeLocation<T extends Tree> implements TreeLocation {
-
+abstract class AbstractNodeLocation<T extends Tree> extends AbstractTreeLocation {
     protected final T tree;
 
     AbstractNodeLocation(T tree) {
         this.tree = checkNotNull(tree);
     }
 
+    protected abstract TreeLocation createNodeLocation(T tree);
+
+    protected abstract TreeLocation createPropertyLocation(AbstractNodeLocation<T>
parentLocation, String name);
+
+    protected abstract T getParentTree();
+
+    protected abstract T getChildTree(String name);
+
+    protected abstract PropertyState getPropertyState(String name);
+
+    protected boolean canRead(T tree) {
+        return true;
+    }
+
+    @Override
+    public TreeLocation getParent() {
+        T parentTree = getParentTree();
+        return parentTree == null
+            ? NullLocation.NULL
+            : createNodeLocation(parentTree);
+    }
+
+    @Override
+    public TreeLocation getChild(String relPath) {
+        checkArgument(!PathUtils.isAbsolute(relPath), "Not a relative path: " + relPath);
+        if (relPath.isEmpty()) {
+            return this;
+        }
+
+        String parent = PathUtils.getParentPath(relPath);
+        if (parent.isEmpty()) {
+            T child = getChildTree(relPath);
+            if (child != null) {
+                return createNodeLocation(child);
+            }
+
+            PropertyState prop = getPropertyState(relPath);
+            if (prop != null) {
+                return createPropertyLocation(this, relPath);
+            }
+            return new NullLocation(this, relPath);
+        }
+        else {
+            return getChild(parent).getChild(PathUtils.getName(relPath));
+        }
+    }
+
     @Override
     public boolean exists() {
         Status status = getStatus();
@@ -41,18 +89,23 @@ abstract class AbstractNodeLocation<T ex
     }
 
     @Override
-    public String getPath() {
-        return tree.getPath();
+    public Tree getTree() {
+        return canRead(tree) ? tree : null;
     }
 
     @Override
-    public PropertyState getProperty() {
-        return null;
+    public Tree.Status getStatus() {
+        return tree.getStatus();
     }
 
     @Override
-    public Tree.Status getStatus() {
-        return tree.getStatus();
+    public String getPath() {
+        return tree.getPath();
+    }
+
+    @Override
+    public boolean remove() {
+        return tree.remove();
     }
 
     @Override

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractPropertyLocation.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractPropertyLocation.java?rev=1443375&r1=1443374&r2=1443375&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractPropertyLocation.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractPropertyLocation.java
Thu Feb  7 09:49:55 2013
@@ -16,42 +16,33 @@
  */
 package org.apache.jackrabbit.oak.core;
 
+import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.api.Tree.Status;
 import org.apache.jackrabbit.oak.api.TreeLocation;
 import org.apache.jackrabbit.oak.commons.PathUtils;
 
-import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkNotNull;
 
 /**
  * AbstractPropertyLocation... TODO
  */
-abstract class AbstractPropertyLocation<T extends Tree, L extends AbstractNodeLocation<T>>
implements TreeLocation {
-
-    protected final L parentLocation;
+abstract class AbstractPropertyLocation<T extends Tree> extends AbstractTreeLocation
{
+    protected final AbstractNodeLocation<T> parentLocation;
     protected final String name;
 
-    AbstractPropertyLocation(L parentLocation, String name) {
+    AbstractPropertyLocation(AbstractNodeLocation<T> parentLocation, String name) {
         this.parentLocation = checkNotNull(parentLocation);
         this.name = checkNotNull(name);
     }
 
-    @Override
-    public L getParent() {
-        return parentLocation;
+    protected boolean canRead(PropertyState property) {
+        return true;
     }
 
     @Override
-    public TreeLocation getChild(String relPath) {
-        checkArgument(!PathUtils.isAbsolute(relPath), "Not a relative path: " + relPath);
-
-        TreeLocation child = this;
-        for (String name : PathUtils.elements(relPath)) {
-            child = new NullLocation(child, name);
-        }
-
-        return child;
+    public TreeLocation getParent() {
+        return parentLocation;
     }
 
     @Override
@@ -61,12 +52,32 @@ abstract class AbstractPropertyLocation<
     }
 
     @Override
+    public PropertyState getProperty() {
+        PropertyState property = parentLocation.getPropertyState(name);
+        return canRead(property)
+            ? property
+            : null;
+    }
+
+    @Override
+    public Status getStatus() {
+        return parentLocation.tree.getPropertyStatus(name);
+    }
+
+    @Override
     public String getPath() {
         return PathUtils.concat(parentLocation.getPath(), name);
     }
 
     @Override
-    public Tree getTree() {
-        return null;
+    public boolean remove() {
+        parentLocation.tree.removeProperty(name);
+        return true;
+    }
+
+    @Override
+    public boolean set(PropertyState property) {
+        parentLocation.tree.setProperty(property);
+        return true;
     }
 }
\ No newline at end of file

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractTreeLocation.java
(from r1443368, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/NullLocation.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractTreeLocation.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractTreeLocation.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/NullLocation.java&r1=1443368&r2=1443375&rev=1443375&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/NullLocation.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractTreeLocation.java
Thu Feb  7 09:49:55 2013
@@ -20,36 +20,12 @@ package org.apache.jackrabbit.oak.core;
 
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Tree;
-import org.apache.jackrabbit.oak.api.Tree.Status;
 import org.apache.jackrabbit.oak.api.TreeLocation;
 import org.apache.jackrabbit.oak.commons.PathUtils;
 
 import static com.google.common.base.Preconditions.checkArgument;
 
-/**
- * This {@code TreeLocation} refers to an invalid location in a tree. That is
- * to a location where no item resides.
- */
-final class NullLocation implements TreeLocation {
-    public static final NullLocation NULL = new NullLocation();
-
-    private final TreeLocation parent;
-    private final String name;
-
-    public NullLocation(TreeLocation parent, String name) {
-        this.parent = parent;
-        this.name = name;
-    }
-
-    private NullLocation() {
-        this.parent = this;
-        this.name = "";
-    }
-
-    @Override
-    public TreeLocation getParent() {
-        return parent;
-    }
+abstract class AbstractTreeLocation implements TreeLocation {
 
     @Override
     public TreeLocation getChild(String relPath) {
@@ -64,28 +40,7 @@ final class NullLocation implements Tree
     }
 
     /**
-     * @return {@code false}
-     */
-    @Override
-    public boolean exists() {
-        return false;
-    }
-
-    @Override
-    public String getPath() {
-        return parent == this ? "" : PathUtils.concat(parent.getPath(), name);
-    }
-
-    /**
-     * @return Always {@code false}.
-     */
-    @Override
-    public boolean remove() {
-        return false;
-    }
-
-    /**
-     * @return  {@code null}
+     * @return {@code null}
      */
     @Override
     public Tree getTree() {
@@ -93,26 +48,10 @@ final class NullLocation implements Tree
     }
 
     /**
-     * @return  {@code null}
+     * @return {@code null}
      */
     @Override
     public PropertyState getProperty() {
         return null;
     }
-
-    /**
-     * @return  {@code null}
-     */
-    @Override
-    public Status getStatus() {
-        return null;
-    }
-
-    /**
-     * @return {@code false}
-     */
-    @Override
-    public boolean set(PropertyState property) {
-        return false;
-    }
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/NullLocation.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/NullLocation.java?rev=1443375&r1=1443374&r2=1443375&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/NullLocation.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/NullLocation.java
Thu Feb  7 09:49:55 2013
@@ -19,18 +19,15 @@
 package org.apache.jackrabbit.oak.core;
 
 import org.apache.jackrabbit.oak.api.PropertyState;
-import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.api.Tree.Status;
 import org.apache.jackrabbit.oak.api.TreeLocation;
 import org.apache.jackrabbit.oak.commons.PathUtils;
 
-import static com.google.common.base.Preconditions.checkArgument;
-
 /**
  * This {@code TreeLocation} refers to an invalid location in a tree. That is
  * to a location where no item resides.
  */
-final class NullLocation implements TreeLocation {
+final class NullLocation extends AbstractTreeLocation {
     public static final NullLocation NULL = new NullLocation();
 
     private final TreeLocation parent;
@@ -51,18 +48,6 @@ final class NullLocation implements Tree
         return parent;
     }
 
-    @Override
-    public TreeLocation getChild(String relPath) {
-        checkArgument(!PathUtils.isAbsolute(relPath), "Not a relative path: " + relPath);
-
-        TreeLocation child = this;
-        for (String e : PathUtils.elements(relPath)) {
-            child = new NullLocation(child, e);
-        }
-
-        return child;
-    }
-
     /**
      * @return {@code false}
      */
@@ -88,22 +73,6 @@ final class NullLocation implements Tree
      * @return  {@code null}
      */
     @Override
-    public Tree getTree() {
-        return null;
-    }
-
-    /**
-     * @return  {@code null}
-     */
-    @Override
-    public PropertyState getProperty() {
-        return null;
-    }
-
-    /**
-     * @return  {@code null}
-     */
-    @Override
     public Status getStatus() {
         return null;
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ReadOnlyTree.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ReadOnlyTree.java?rev=1443375&r1=1443374&r2=1443375&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ReadOnlyTree.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ReadOnlyTree.java
Thu Feb  7 09:49:55 2013
@@ -19,6 +19,7 @@
 package org.apache.jackrabbit.oak.core;
 
 import java.util.Iterator;
+
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 
@@ -27,7 +28,6 @@ import org.apache.jackrabbit.oak.api.Roo
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.api.TreeLocation;
 import org.apache.jackrabbit.oak.api.Type;
-import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 
@@ -247,47 +247,28 @@ public class ReadOnlyTree implements Tre
         }
 
         @Override
-        public TreeLocation getParent() {
-            return tree.parent == null
-                    ? NullLocation.NULL
-                    : new NodeLocation(tree.parent);
+        protected TreeLocation createNodeLocation(ReadOnlyTree tree) {
+            return new NodeLocation(tree);
         }
 
         @Override
-        public TreeLocation getChild(String relPath) {
-            checkArgument(!PathUtils.isAbsolute(relPath), "Not a relative path: " + relPath);
-            if (relPath.isEmpty()) {
-                return this;
-            }
+        protected TreeLocation createPropertyLocation(AbstractNodeLocation<ReadOnlyTree>
parentLocation, String name) {
+            return new PropertyLocation(parentLocation, name);
+        }
 
-            int slash = PathUtils.getNextSlash(relPath, 0);
-            if (slash == -1) {
-                ReadOnlyTree child = tree.getChild(relPath);
-                if (child != null) {
-                    return new NodeLocation(child);
-                }
-
-                PropertyState prop = tree.getProperty(relPath);
-                if (prop != null) {
-                    return new PropertyLocation(this, relPath);
-                }
-                return new NullLocation(this, relPath);
-            }
-            else {
-                String name = relPath.substring(0, slash);
-                String tail = relPath.substring(slash + 1, relPath.length());
-
-                ReadOnlyTree child = tree.getChild(name);
-                if (child != null) {
-                    return new NodeLocation(child).getChild(tail);
-                }
-                return new NullLocation(this, name).getChild(tail);
-            }
+        @Override
+        protected ReadOnlyTree getParentTree() {
+            return tree.parent;
         }
 
         @Override
-        public boolean remove() {
-            return false;
+        protected ReadOnlyTree getChildTree(String name) {
+            return tree.getChild(name);
+        }
+
+        @Override
+        protected PropertyState getPropertyState(String name) {
+            return tree.getProperty(name);
         }
 
         @Override
@@ -296,30 +277,25 @@ public class ReadOnlyTree implements Tre
         }
 
         @Override
-        public Status getStatus() {
-            return tree.getStatus();
+        public boolean remove() {
+            return false;
         }
     }
 
-    private final class PropertyLocation extends AbstractPropertyLocation<ReadOnlyTree,
NodeLocation> {
+    private final class PropertyLocation extends AbstractPropertyLocation<ReadOnlyTree>
{
 
-        private PropertyLocation(NodeLocation parentLocation, String name) {
+        private PropertyLocation(AbstractNodeLocation<ReadOnlyTree> parentLocation,
String name) {
             super(parentLocation, name);
         }
 
         @Override
-        public boolean remove() {
-            return false;
-        }
-
-        @Override
         public PropertyState getProperty() {
             return parentLocation.tree.getProperty(name);
         }
 
         @Override
-        public Status getStatus() {
-            return Status.EXISTING;
+        public boolean remove() {
+            return false;
         }
 
         @Override

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java?rev=1443375&r1=1443374&r2=1443375&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
Thu Feb  7 09:49:55 2013
@@ -34,7 +34,6 @@ import org.apache.jackrabbit.oak.api.Pro
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.api.TreeLocation;
 import org.apache.jackrabbit.oak.api.Type;
-import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.plugins.memory.MemoryPropertyBuilder;
 import org.apache.jackrabbit.oak.plugins.memory.MultiStringPropertyState;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
@@ -591,90 +590,47 @@ public class TreeImpl implements Tree {
         }
 
         @Override
-        public TreeLocation getParent() {
-            return tree.parent == null
-                    ? NullLocation.NULL
-                    : new NodeLocation(tree.parent);
+        protected NodeLocation createNodeLocation(TreeImpl tree) {
+            return new NodeLocation(tree);
         }
 
         @Override
-        public TreeLocation getChild(String relPath) {
-            checkArgument(!PathUtils.isAbsolute(relPath), "Not a relative path: " + relPath);
-            if (relPath.isEmpty()) {
-                return this;
-            }
-
-            int slash = PathUtils.getNextSlash(relPath, 0);
-            if (slash == -1) {
-                TreeImpl child = tree.internalGetChild(relPath);
-                if (child != null) {
-                    return new NodeLocation(child);
-                }
-
-                PropertyState prop = tree.internalGetProperty(relPath);
-                if (prop != null) {
-                    return new PropertyLocation(this, relPath);
-                }
-                return new NullLocation(this, relPath);
-            }
-            else {
-                String name = relPath.substring(0, slash);
-                String tail = relPath.substring(slash + 1, relPath.length());
-
-                TreeImpl child = tree.internalGetChild(name);
-                if (child != null) {
-                    return new NodeLocation(child).getChild(tail);
-                }
-                return new NullLocation(this, name).getChild(tail);
-            }
+        protected TreeLocation createPropertyLocation(AbstractNodeLocation<TreeImpl>
parentLocation, String name) {
+            return new PropertyLocation(parentLocation, name);
         }
 
         @Override
-        public boolean remove() {
-            return tree.remove();
+        protected TreeImpl getParentTree() {
+            return tree.parent;
         }
 
         @Override
-        public Tree getTree() {
-            return canRead(tree) ? tree : null;
-        }
-    }
-
-    private final class PropertyLocation extends AbstractPropertyLocation<TreeImpl, NodeLocation>
{
-
-        private PropertyLocation(NodeLocation parentLocation, String name) {
-            super(parentLocation, name);
+        protected TreeImpl getChildTree(String name) {
+            return tree.internalGetChild(name);
         }
 
         @Override
-        public PropertyState getProperty() {
-            PropertyState property = parentLocation.tree.internalGetProperty(name);
-            return canRead(property)
-                    ? property
-                    : null;
+        protected PropertyState getPropertyState(String name) {
+            return tree.internalGetProperty(name);
         }
 
         @Override
-        public Status getStatus() {
-            return parentLocation.tree.getPropertyStatus(name);
+        protected boolean canRead(TreeImpl tree) {
+            return TreeImpl.this.canRead(tree);
         }
+    }
 
-        @Override
-        public boolean set(PropertyState property) {
-            parentLocation.tree.setProperty(property);
-            return true;
+    private final class PropertyLocation extends AbstractPropertyLocation<TreeImpl>
{
+
+        private PropertyLocation(AbstractNodeLocation<TreeImpl> parentLocation, String
name) {
+            super(parentLocation, name);
         }
 
-        /**
-         * Remove the underlying property
-         *
-         * @return {@code true} on success false otherwise
-         */
         @Override
-        public boolean remove() {
-            parentLocation.tree.removeProperty(name);
-            return true;
+        protected boolean canRead(PropertyState property) {
+            return TreeImpl.this.canRead(property);
         }
+
     }
 
 }

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/TreeLocationTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/TreeLocationTest.java?rev=1443375&r1=1443374&r2=1443375&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/TreeLocationTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/TreeLocationTest.java
Thu Feb  7 09:49:55 2013
@@ -50,7 +50,7 @@ public class TreeLocationTest {
         tree.setProperty("c", 3);
         tree.addChild("x");
         tree.addChild("y");
-        tree.addChild("z");
+        tree.addChild("z").addChild("1").addChild("2").setProperty("p", "v");
         root.commit();
 
         // Acquire a fresh new root to avoid problems from lingering state
@@ -108,4 +108,20 @@ public class TreeLocationTest {
 
         assertEquals(a.getProperty(), ab.getParent().getProperty());
     }
+
+    @Test
+    public void getDeepLocation() {
+        TreeLocation p = root.getLocation("/z/1/2/p");
+        assertNotNull(p.getProperty());
+        assertEquals("/z/1/2/p", p.getPath());
+
+        TreeLocation n = root.getLocation("/z/1/2/3/4");
+        assertNull(n.getTree());
+        assertNull(n.getProperty());
+        assertEquals("/z/1/2/3/4", n.getPath());
+
+        TreeLocation two = n.getParent().getParent();
+        assertNotNull(two.getTree());
+        assertEquals("/z/1/2", two.getPath());
+    }
 }



Mime
View raw message