예제 #1
0
  public void testOrphansAreRemoved() throws Exception {
    performImportWithExtraLocalPages();

    assertFalse(localRoot.hasChildPage("PageThree"));
    assertFalse(pageOne.hasChildPage("ChildTwo"));
    assertFalse(childPageOne.hasChildPage("GrandChildOne"));

    assertTrue(localRoot.hasChildPage("PageThatDoesntImport"));
    assertTrue(localRoot.hasChildPage("OtherImportRoot"));
  }
예제 #2
0
  public void testWholeTreeOrphaned() throws Exception {
    importer.importWiki(localRoot);

    remoteRoot.removeChildPage("PageOne");

    importer.importWiki(localRoot);

    assertFalse(localRoot.hasChildPage("PageOne"));
  }
예제 #3
0
 private boolean isValidWikiPageName(String linkName, WikiPageProperty symLinks) throws Exception {
   if (page.hasChildPage(linkName) && !symLinks.has(linkName)) {
     response =
         new ErrorResponder(resource + " already has a child named " + linkName + ".")
             .makeResponse(context, null);
     response.setStatus(412);
     return false;
   } else if (!PathParser.isSingleWikiWord(linkName)) {
     response =
         new ErrorResponder(linkName + " is not a valid WikiWord.").makeResponse(context, null);
     response.setStatus(412);
     return false;
   }
   return true;
 }
예제 #4
0
 private boolean targetPageExists() throws Exception {
   return newParentPage.hasChildPage(getNewPageName());
 }