@Test
 public void testLoadChildrenWhenPageIsDeletedManualy() throws Exception {
   WikiPage page = crawler.addPage(root, PathParser.parse("TestPage"));
   page.getChildren();
   FileUtil.deleteFileSystemDirectory(((FileSystemPage) page).getFileSystemPath());
   try {
     page.getChildren();
   } catch (Exception e) {
     fail("No Exception should be thrown");
   }
 }
예제 #2
0
  public void testImportingWiki() throws Exception {
    localRoot = InMemoryPage.makeRoot("LocalRoot");
    importer.importWiki(localRoot);

    assertEquals(2, localRoot.getChildren().size());
    assertEquals(3, imports.size());
    assertEquals(0, errors.size());
  }
예제 #3
0
 protected void moveChildren(WikiPage movedPage, WikiPage newParentPage) throws Exception {
   List<WikiPage> children = movedPage.getChildren();
   for (WikiPage page : children) {
     movePage(page, newParentPage.addChildPage(page.getName()));
   }
 }