private void validateLoading() throws Exception {
    assertTrue(properties.has("Edit"));
    assertTrue(properties.has("Test"));
    assertFalse(properties.has("Suite"));
    assertEquals("http://someurl", properties.get("VirtualWiki"));

    WikiPageProperty parentOne = properties.getProperty("ParentOne");
    assertEquals(null, parentOne.getValue());
    assertEquals("child one value", parentOne.get("ChildOne"));

    WikiPageProperty parentTwo = properties.getProperty("ParentTwo");
    assertEquals("parent 2 value", parentTwo.getValue());
    assertEquals("child two value", parentTwo.get("ChildTwo"));

    WikiPageProperty symbolics = properties.getProperty("SymbolicLinks");
    assertEquals("<BackWard.SymLink", symbolics.get("BackLink"));
    assertEquals("RelaTive.SymLink", symbolics.get("RelLink"));
    assertEquals(".AbsoLute.SymLink", symbolics.get("AbsLink"));
    assertEquals(">SubChild.SymLink", symbolics.get("SubLink"));
  }
示例#2
0
 protected List<WikiPage> getSymlinkChildren(WikiPage page) {
   List<WikiPage> children = new LinkedList<>();
   WikiPageProperties props = page.getData().getProperties();
   WikiPageProperty symLinksProperty = props.getProperty(SymbolicPage.PROPERTY_NAME);
   if (symLinksProperty != null) {
     for (String linkName : symLinksProperty.keySet()) {
       WikiPage linkedPage = createSymbolicPage(page, linkName);
       if (linkedPage != null && !children.contains(linkedPage)) children.add(linkedPage);
     }
   }
   return children;
 }