Package fitnesse.wiki

Examples of fitnesse.wiki.WikiPage


  }

  @Test
  public void translatesIncludedSibling() throws Exception {
    TestRoot root = new TestRoot();
    WikiPage currentPage = root.makePage("PageOne", "!include PageTwo");
    root.makePage("PageTwo", "page ''two''");

    String result = ParserTestHelper.translateTo(currentPage);

    assertContains(result, "class=\"collapsible\"");
View Full Code Here


  }

  @Test
  public void translatesIncludeWithChildReference() throws Exception {
    TestRoot root = new TestRoot();
    WikiPage currentPage = root.makePage("PageOne", "!include PageTwo");
    WikiPage pageTwo = root.makePage("PageTwo", ">PageTwoChild");
    root.makePage(pageTwo, "PageTwoChild", "stuff");
    String result = ParserTestHelper.translateTo(currentPage);
    assertContains(result, "PageTwo.PageTwoChild");
  }
View Full Code Here

  }

  @Test
  public void translatesRelativeInclude() throws Exception {
    TestRoot root = new TestRoot();
    WikiPage currentPage = root.makePage("PageOne", "!include >PageOneChild");
    root.makePage(currentPage, "PageOneChild", "stuff");
    String result = ParserTestHelper.translateTo(currentPage);
    assertContains(result, "stuff");
  }
View Full Code Here

  }

  @Test
  public void translatesNestedRelativeInclude() throws Exception {
    TestRoot root = new TestRoot();
    WikiPage currentPage = root.makePage("PageOne", "!include >PageOneChild");
    WikiPage pageOneChild = root.makePage(currentPage, "PageOneChild", "!include >PageOneGrandChild");
    root.makePage(pageOneChild, "PageOneGrandChild", "stuff");
    String result = ParserTestHelper.translateTo(currentPage);
    assertContains(result, "stuff");
  }
View Full Code Here

  }

  @Test
  public void translatesCollapsed() throws Exception {
    TestRoot root = new TestRoot();
    WikiPage includingPage = root.makePage("PageOne", "!include -c PageTwo");
    root.makePage("PageTwo", "two");

    String result = ParserTestHelper.translateTo(includingPage);

    assertContains(result, "class=\"collapsible closed\"");
View Full Code Here

  }

  @Test
  public void translatesSeamless() throws Exception {
    TestRoot root = new TestRoot();
    WikiPage includingPage = root.makePage("PageOne", "!include -seamless PageTwo");
    root.makePage("PageTwo", "two");

    ParserTestHelper.assertTranslatesTo(includingPage, "two");
  }
View Full Code Here

  }
 
  @Test
  public void translatesHelp() throws Exception {
    TestRoot root = new TestRoot();
    WikiPage includingPage = root.makePage("PageOne", "!include -h PageTwo");
   
    WikiPage pageWithHelp = root.makePage("PageTwo", "two");
    PageData pageData = pageWithHelp.getData();
    pageData.setAttribute(PageData.PropertyHELP, "help me");
    pageWithHelp.commit(pageData);

    ParserTestHelper.assertTranslatesTo(includingPage, "help me");
  }
View Full Code Here

      + "\t<div><span class=\"error\">%s</span></div>" + NEW_LINE
      + "</div>" + NEW_LINE;
  @Test
  public void doesNotIncludeParent() throws Exception {
    TestRoot root = new TestRoot();
    WikiPage parent = root.makePage("ParentPage", "stuff");
    WikiPage currentPage = root.makePage(parent, "PageOne", "!include <ParentPage");
    ParserTestHelper.assertTranslatesTo(currentPage, String.format(HTML_ERR,
        "<a href=\"ParentPage\">&lt;ParentPage</a>",
        "Error! Cannot include parent page (&lt;ParentPage)."));
  }
View Full Code Here

  }

  @Test
  public void doesNotIncludeInvalidPageName() throws Exception {
    TestRoot root = new TestRoot();
    WikiPage parent = root.makePage("ParentPage", "stuff");
    WikiPage currentPage = root.makePage(parent, "PageOne", "!include not.a.+wiki.page");
    ParserTestHelper.assertTranslatesTo(currentPage, String.format(HTML_ERR,
        "not.a.+wiki.page",
        "Page include failed because the page not.a.+wiki.page does not have a valid WikiPage name."));
  }
View Full Code Here

  }

  @Test
  public void doesNotIncludeNotExistingPageName() throws Exception {
    TestRoot root = new TestRoot();
    WikiPage parent = root.makePage("ParentPage", "stuff");
    WikiPage currentPage = root.makePage(parent, "PageOne", "!include NotExistingPage");
    ParserTestHelper.assertTranslatesTo(currentPage, String.format(HTML_ERR,
        "NotExistingPage<a title=\"create page\" href=\"ParentPage.NotExistingPage?edit&amp;nonExistent=true\">[?]</a>",
        "Page include failed because the page NotExistingPage does not exist."));
  }
View Full Code Here

TOP

Related Classes of fitnesse.wiki.WikiPage

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.