@Test public void testFurtherPrefixEntry() { HMSPaths.Entry root = HMSPaths.Entry.createRoot(false); HMSPaths.Entry entry = root.createPrefix(Lists.newArrayList("a", "b")); entry.toString(); Assert.assertEquals(1, root.childrenValues().size()); Assert.assertEquals(root, entry.getParent().getParent()); Assert.assertEquals(HMSPaths.EntryType.PREFIX, entry.getType()); Assert.assertEquals(HMSPaths.EntryType.DIR, entry.getParent().getType()); Assert.assertEquals("b", entry.getPathElement()); Assert.assertEquals("a", entry.getParent().getPathElement()); Assert.assertTrue(entry.getAuthzObjsSize() == 0); Assert.assertTrue(entry.isAuthzObjsEmpty()); Assert.assertTrue(entry.getParent().getAuthzObjsSize() == 0); Assert.assertTrue(entry.getAuthzObjs().size() == 0); Assert.assertTrue(entry.getParent().getAuthzObjs().size() == 0); Assert.assertEquals(Path.SEPARATOR + "a" + Path.SEPARATOR + "b", entry.getFullPath()); Assert.assertEquals(Path.SEPARATOR + "a", entry.getParent().getFullPath()); Assert.assertFalse(entry.hasChildren()); Assert.assertEquals(1, entry.getParent().childrenValues().size()); Assert.assertEquals(entry, root.findPrefixEntry(Lists.newArrayList("a", "b"))); Assert.assertNull(root.findPrefixEntry(Lists.newArrayList("a"))); Assert.assertNull(root.find(new String[]{"a", "b", "c"}, false)); try { root.createPrefix(Lists.newArrayList("a", "b")); Assert.fail(); } catch (IllegalArgumentException ex) { } try { root.createPrefix(Lists.newArrayList("a", "b", "c")); Assert.fail(); } catch (IllegalArgumentException ex) { } entry.delete(); Assert.assertFalse(root.hasChildren()); }
@Override public String toString() { return String.format("%s:%s", getClass().getSimpleName(), Arrays.toString(prefixes)); }
HMSPaths implements AuthzPaths { @Override public String toString() { return String.format("%s:%s", getClass().getSimpleName(), Arrays.toString(prefixes)); } }
HMSPaths implements AuthzPaths { @Override public String toString() { return String.format("%s:%s", getClass().getSimpleName(), Arrays.toString(prefixes)); } HMSPaths();  HMSPaths(String[] pathPrefixes); }
HMSPaths implements AuthzPaths { @Override public String toString() { return String.format("%s:%s", getClass().getSimpleName(), Arrays.toString(prefixes)); } HMSPaths();  HMSPaths(String[] pathPrefixes); @Override Set<String> findAuthzObject(String[] pathElements); @Override Set<String> findAuthzObjectExactMatches(String[] pathElements); Set<String> findAuthzObject(String[] pathElements, boolean isPartialOk); @Override boolean isUnderPrefix(String[] pathElements); Collection<Entry> getAllEntries(); @Override HMSPathsDumper getPathsDump(); @Override String toString(); String dumpContent(); }
HMSPaths implements AuthzPaths { @Override public String toString() { return String.format("%s:%s", getClass().getSimpleName(), Arrays.toString(prefixes)); } HMSPaths();  HMSPaths(String[] pathPrefixes); @Override Set<String> findAuthzObject(String[] pathElements); @Override Set<String> findAuthzObjectExactMatches(String[] pathElements); Set<String> findAuthzObject(String[] pathElements, boolean isPartialOk); @Override boolean isUnderPrefix(String[] pathElements); Collection<Entry> getAllEntries(); @Override HMSPathsDumper getPathsDump(); @Override String toString(); String dumpContent();  }