Package fitnesse.wiki

Examples of fitnesse.wiki.PageData


  @Test
  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());
View Full Code Here


    importer.enterChildPage(childPageOne, Clock.currentDate());
    importer.exitPage();
    importer.exitPage();
    importer.enterChildPage(pageTwo, Clock.currentDate());

    PageData data = pageTwo.getData();
    assertEquals("page two", data.getContent());
  }
View Full Code Here

  @Test
  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));
View Full Code Here

    assertTrue(importProps.isAutoUpdate());
  }

  private WikiPage addLocalPageWithImportProperty(WikiPage parentPage, String pageName, boolean isRoot) throws Exception {
    WikiPage page = parentPage.addChildPage(pageName);
    PageData data = page.getData();

    WikiPagePath pagePath = page.getPageCrawler().getFullPath();
    WikiImportProperty importProps = new WikiImportProperty("http://localhost:" + FitNesseUtil.PORT + "/" + PathParser.render(pagePath));
    if (isRoot)
      importProps.setRoot(true);
    importProps.addTo(data.getProperties());
    page.commit(data);

    return page;
  }
View Full Code Here

    FileUtil.deleteFileSystemDirectory(rootPath);
  }

  private Object doSetUpWith(WikiPage root, String proxyType) throws Exception {
    WikiPage page1 = WikiPageUtil.addPage(root, PathParser.parse("PageOne"), "this is page one");
    PageData data = page1.getData();
    data.setAttribute("Attr1", "true");
    page1.commit(data);
    WikiPageUtil.addPage(page1, PathParser.parse("ChildOne"), "this is child one");

    request.addInput("type", proxyType);
    request.setResource("PageOne");
View Full Code Here

  @Test
  public void testGetContentAndAttributes() throws Exception {
    Object obj = doSetUpWith(root, "meat");
    assertNotNull(obj);
    assertTrue(obj instanceof PageData);
    PageData data = (PageData) obj;

    assertEquals("this is page one", data.getContent());

    WikiPageProperties props = data.getProperties();
    assertTrue(props.has("Attr1"));
  }
View Full Code Here

    request.addInput("version", commitRecord.getName());
    request.setResource("PageOne");

    Object obj = getObject(root, request);
    assertEquals(PageData.class, obj.getClass());
    PageData data = (PageData) obj;
    assertEquals("some content", data.getContent());
  }
View Full Code Here

    checkChangesOnPageOne("Stuff .SubWiki.PageTwo.NoPage Stuff\n", "Stuff .SubWiki.PageThree.NoPage Stuff\n");
  }

  @Test
  public void testTestReferencesToSubWiki_1() throws Exception {
    PageData data = subWiki.getData();
    data.setContent("Stuff >PageTwo Stuff\n");
    subWiki.commit(data);

    renamer = new PageReferenceRenamer(root, subWiki_pageTwo, "PageThree");
    renamer.renameReferences();
View Full Code Here

    assertEquals("Stuff >PageThree Stuff\n", updatedSubWikiContent);
  }

  @Test
  public void testTestReferencesToSubWiki_2() throws Exception {
    PageData data = subWiki.getData();
    data.setContent("Stuff >PageTwo.DeepPage Stuff\n");
    subWiki.commit(data);

    renamer = new PageReferenceRenamer(root, subWiki_pageTwo, "PageThree");
    renamer.renameReferences();
    String updatedSubWikiContent = subWiki.getData().getContent();
View Full Code Here

    assertEquals(expectedAfterText, updatedPageOneContent);
  }

  @Test
  public void testRenameParentPage() throws Exception {
    PageData pageTwoChildData = subWiki_pageTwo_pageTwoChild.getData();
    pageTwoChildData.setContent("gunk .SubWiki.PageTwo gunk");
    subWiki_pageTwo_pageTwoChild.commit(pageTwoChildData);
    renamer = new PageReferenceRenamer(root, subWiki_pageTwo, "PageThree");
    renamer.renameReferences();
    String updatedContent = subWiki_pageTwo_pageTwoChild.getData().getContent();
    assertEquals("gunk .SubWiki.PageThree gunk", updatedContent);
View Full Code Here

TOP

Related Classes of fitnesse.wiki.PageData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.