コード例 #1
0
  public void testChildPageAdded() throws Exception {
    importer.enterChildPage(pageOne, Clock.currentDate());
    importer.enterChildPage(childPageOne, Clock.currentDate());

    PageData data = childPageOne.getData();
    assertEquals("child one", data.getContent());
  }
コード例 #2
0
  public void testExiting() throws Exception {
    importer.enterChildPage(pageOne, Clock.currentDate());
    importer.enterChildPage(childPageOne, Clock.currentDate());
    importer.exitPage();
    importer.exitPage();
    importer.enterChildPage(pageTwo, Clock.currentDate());

    PageData data = pageTwo.getData();
    assertEquals("page two", data.getContent());
  }
コード例 #3
0
  public void testAutoUpdate_NewPage() throws Exception {
    importer.setAutoUpdateSetting(true);
    importer.enterChildPage(pageOne, Clock.currentDate());

    WikiImportProperty importProps =
        WikiImportProperty.createFrom(pageOne.getData().getProperties());
    assertTrue(importProps.isAutoUpdate());
  }
コード例 #4
0
  public void testEnterChildPageWhenRemotePageNotModified() throws Exception {
    importer.enterChildPage(pageOne, Clock.currentDate());
    importer.exitPage();

    PageData data = pageOne.getData();
    data.setContent("new content");
    pageOne.commit(data);

    importer.enterChildPage(pageOne, new Date(0));

    assertEquals("new content", pageOne.getData().getContent());
  }
コード例 #5
0
  public void testAutoUpdateWhenRemotePageNotModified() throws Exception {
    importer.enterChildPage(pageOne, Clock.currentDate());
    importer.exitPage();

    PageData data = pageOne.getData();
    data.setContent("new content");
    pageOne.commit(data);

    importer.setAutoUpdateSetting(true);
    importer.enterChildPage(pageOne, new Date(0));

    WikiImportProperty importProps =
        WikiImportProperty.createFrom(pageOne.getData().getProperties());
    assertTrue(importProps.isAutoUpdate());
  }
コード例 #6
0
 protected VersionInfo makeVersion() {
   return new VersionInfo("abc", "Jon", Clock.currentDate());
 }