DepTreeNode implements Cloneable, Serializable { public String getParentPath() { StringBuffer sb = new StringBuffer(); DepTreeNode parentRef = parent.get(); if (parentRef != null) { String path = parentRef.getParentPath(); if (path != null) { sb.append(path); } sb.append(sb.length() == 0 ? "" : "/").append(parentRef.getName()); } else { return null; } return sb.toString(); } DepTreeNode(String name, URI uri); String getName(); long lastModified(); long lastModifiedDep(); long lastModifiedDepTree(); DepTreeNode getParent(); DepTreeNode getRoot(); String[] getDefineDepArray(); String[] getRequireDepArray(); String[] getDependentFeatures(); String getParentPath(); String getFullPathName(); void add(DepTreeNode child); void overlay(DepTreeNode node); void addAll(Collection<DepTreeNode> children); DepTreeNode createOrGet(String path, URI uri); DepTreeNode getDescendent(String path); void remove(DepTreeNode child); void removeAll(); Map<String, DepTreeNode> getChildren(); DepTreeNode getChild(String name); void prune(); void setDependencies(String[] defineDependencies, String[] requireDependencies, String[] dependentFeatures, long lastModifiedFile, long lastModifiedDep); @Override String toString(); String toStringTree(); @Override DepTreeNode clone(); IConfig getConfig();  }
@Test public void testGetParentPath() { DepTreeNode root = new DepTreeNode("root", null); DepTreeNode child = new DepTreeNode("child", null); DepTreeNode grandchild = new DepTreeNode("grandchild", null); root.add(child); child.add(grandchild); assertNull(root.getParentPath()); assertEquals("root", child.getParentPath()); assertEquals("root/child", grandchild.getParentPath()); }