Package fitnesse.wiki

Examples of fitnesse.wiki.PageData


            descendent.getPageCrawler().getFullPath());
  }

  @Test
  public void testMovePage() throws Exception {
    PageData data = pageA.getData();
    data.setAttribute("someAttribute", "someValue");
    pageA.commit(data);

    final String sourcePage = "PageOne.PageA";
    final String destinationPage = "PageTwo.PageA";
    final String destinationParent = "PageTwo";

    assertTrue(crawler.pageExists(PathParser.parse(sourcePage)));
    assertFalse(crawler.pageExists(PathParser.parse(destinationPage)));

    movePage(sourcePage, destinationParent, true);
    assertTrue(crawler.pageExists(PathParser.parse(destinationPage)));
    assertFalse(crawler.pageExists(PathParser.parse(sourcePage)));

    WikiPagePath destinationPath = PathParser.parse(destinationPage);
    WikiPage movedPage = crawler.getPage(destinationPath);
    data = movedPage.getData();
    assertEquals("content", data.getContent());
    assertEquals("someValue", data.getAttribute("someAttribute"));
  }
View Full Code Here


        assertTranslates(" <a href=\"TestHelp?properties\">(edit help text)</a>", "!help -editable", PageData.PropertySUITES);
    }

    private void assertTranslates(String expected, String content, String property) throws Exception {
        WikiPage pageWithHelp = new TestRoot().makePage("TestHelp", content);
        PageData pageData = pageWithHelp.getData();
        pageData.setAttribute(property, "help me");
        pageWithHelp.commit(pageData);
        ParserTestHelper.assertTranslatesTo(pageWithHelp, expected);
    }
View Full Code Here

  public String lastModifiedOfPage(String pageName) throws Exception {
    WikiPage root = FitnesseFixtureContext.root;
    WikiPagePath pagePath = PathParser.parse(pageName);
    WikiPage thePage = root.getPageCrawler().getPage(pagePath);
    PageData data = thePage.getData();
    return data.getAttribute(PageData.LAST_MODIFYING_USER);
  }
View Full Code Here

  private void onPageSetAttribute(String pageName, String attrName) {
    WikiPage root = FitnesseFixtureContext.root;
    WikiPagePath pagePath = PathParser.parse(pageName);
    WikiPage thePage = root.getPageCrawler().getPage(pagePath);
    PageData data = thePage.getData();
    data.setAttribute(attrName, "true");
    thePage.commit(data);
  }
View Full Code Here

  }

  public boolean pageHasAttribute(String fullPathOfPage, String attribute) throws Exception {
    PageCrawler crawler = FitnesseFixtureContext.root.getPageCrawler();
    WikiPage page = crawler.getPage(PathParser.parse(fullPathOfPage));
    PageData data = page.getData();
    return data.hasAttribute(attribute);
  }
View Full Code Here

  @Before
  public void setUp() throws Exception {
    root = InMemoryPage.makeRoot("RooT");
    WikiPage testPage = root.addChildPage("TestPage");
    PageData data = testPage.getData();
    WikiPageProperties properties = data.getProperties();
    properties.set(PageData.PropertySUITES, "Test Page tags");
    testPage.commit(data);
    context = FitNesseUtil.makeTestContext(root);
    log = new CompositeExecutionLog(testPage);
  }
View Full Code Here

  @Before
  public void setUp() throws Exception {
    WikiPage root = InMemoryPage.makeRoot("RooT");
    page = WikiPageUtil.addPage(root, PathParser.parse("PageOne"), "original content");
    PageData data = page.getData();
    data.setContent("new stuff");
    data.setProperties(new WikiPageProperties());
    VersionInfo commitRecord = last(page.getVersions());
    page.commit(data);

    MockRequest request = new MockRequest();
    request.setResource("PageOne");
View Full Code Here

  @Test
  public void testStuff() throws Exception {
    assertEquals(303, response.getStatus());
    assertEquals("/PageOne", response.getHeader("Location"));

    PageData data = page.getData();
    assertEquals("original content", data.getContent());
    assertEquals(true, data.hasAttribute("Edit"));
  }
View Full Code Here

  private void makeTestResponse(String pageName) throws Exception {
    WikiPage root = InMemoryPage.makeRoot("RooT");
    FitNesseContext context = FitNesseUtil.makeTestContext(root);
    WikiPage page = WikiPageUtil.addPage(root, PathParser.parse(pageName), "original content ${requestParam}");
    PageData data = page.getData();
   
    WikiPageProperties properties = data.getProperties();
    properties.set(PageData.PropertySUITES, "New Page tags");
    data.setContent("new stuff");
    VersionInfo commitRecord = last(page.getVersions());
    oldVersion = commitRecord.getName();
    page.commit(data);
    MockRequest request = new MockRequest();
    request.setResource(pageName);
View Full Code Here

  public void testGetPageHieratchyAsXmlDoesntContainSymbolicLinks() throws Exception {
    WikiPage pageOne = WikiPageUtil.addPage(root, PathParser.parse("PageOne"), "");
    WikiPageUtil.addPage(root, PathParser.parse("PageOne.ChildOne"), "");
    WikiPageUtil.addPage(root, PathParser.parse("PageTwo"), "");

    PageData data = pageOne.getData();
    WikiPageProperties properties = data.getProperties();
    WikiPageProperty symLinks = properties.set(SymbolicPage.PROPERTY_NAME);
    symLinks.set("SymPage", "PageTwo");
    pageOne.commit(data);

    request.setResource("root");
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.