Package fitnesse.wiki

Examples of fitnesse.wiki.WikiPage


    sender.doSending(response);
    return sender.sentData();
  }

  private MockRequest setupRequest() throws Exception {
    WikiPage page = WikiPageUtil.addPage(root, PathParser.parse("PageOne"));
    PageData data = page.getData();
    data.setContent("some content");
    WikiPageProperties properties = data.getProperties();
    properties.set(TEST.toString(), "true");
    properties.set("Suites", "filter1,filter2");
    page.commit(data);

    MockRequest request = new MockRequest();
    request.setResource("PageOne");
    request.addInput("Action", "Any");
    request.addInput("Security", "Any");
View Full Code Here


    assertSubString("No pages", content);
  }

  private MockRequest setupRequestForObsoletePage() throws Exception {
    WikiPage page = WikiPageUtil.addPage(root, PathParser.parse("ObsoletePage"));
    PageData data = page.getData();
    data.setContent("some content");
    WikiPageProperties properties1 = data.getProperties();
    properties1.set(TEST.toString(), "true");
    properties1.set("Suites", "filter1,filter2");
    WikiPageProperties properties = properties1;
    properties.set(PropertyPRUNE, "true");
    page.commit(data);

    MockRequest request = setupRequest();
    request.setResource("ObsoletePage");
    return request;
  }
View Full Code Here

    request = new MockRequest();
  }

  @Test
  public void testResponse() throws Exception {
    WikiPage page = WikiPageUtil.addPage(root, PathParser.parse("PageOne"), "");
    PageData data = page.getData();
    data.setContent("some content");
    WikiPageProperties properties = data.getProperties();
    properties.set(PageData.PropertySUITES, "Page Tags");
    properties.set("Test", "true");
    page.commit(data);

    MockRequest request = new MockRequest();
    request.setResource("PageOne");

    Responder responder = new PropertiesResponder();
View Full Code Here

    assertSubString("<input type=\"checkbox\" id=\"" + attribute + "\" name=\"" + attribute + "\" checked=\"checked\"/>", content);
  }

  @Test
  public void testJsonResponse() throws Exception {
    WikiPage page = WikiPageUtil.addPage(root, PathParser.parse("PageOne"));
    PageData data = page.getData();
    WikiPageProperties properties = data.getProperties();
    properties.set(PageType.TEST.toString(), "true");
    page.commit(data);

    MockRequest request = new MockRequest();
    request.setResource("PageOne");
    request.addInput("format", "json");
View Full Code Here

    assertFalse(jsonObject.getBoolean(PageData.PropertySECURE_TEST));
  }

  @Test
  public void testJsonResponseWithHelpTextAndTags() throws Exception {
    WikiPage page = WikiPageUtil.addPage(root, PathParser.parse("PageOne"));
    PageData data = page.getData();
    WikiPageProperties properties = data.getProperties();
    properties.set(PropertyHELP, "help text");
    properties.set(PropertySUITES, "foo,bar");
    page.commit(data);

    MockRequest request = new MockRequest();
    request.setResource("PageOne");
    request.addInput("format", "json");
View Full Code Here

  }


  @Test
  public void testUsernameDisplayed() throws Exception {
    WikiPage page = getContentFromSimplePropertiesPage();

    assertSubString("Last modified anonymously", content);

    PageData data = page.getData();
    data.setAttribute(PageData.LAST_MODIFYING_USER, "Bill");
    page.commit(data);

    request.setResource("SomePage");
    SimpleResponse response = (SimpleResponse) responder.makeResponse(context, request);
    content = response.getContent();
View Full Code Here

    assertSubString("Last modified by Bill", content);
  }

  private WikiPage getContentFromSimplePropertiesPage() throws Exception {
    WikiPage page = WikiPageUtil.addPage(root, PathParser.parse("SomePage"));

    return getPropertiesContentFromPage(page);
  }
View Full Code Here

    assertSubString("Automatically update imported content when executing tests", content);
  }

  private void testWikiImportUpdateWith(WikiImportProperty property) throws Exception {
    WikiPage page = WikiPageUtil.addPage(root, PathParser.parse("SomePage"));
    PageData data = page.getData();
    property.addTo(data.getProperties());
    page.commit(data);

    getPropertiesContentFromPage(page);
    checkUpdateForm();
    assertSubString("Wiki Import Update", content);
    assertSubString("<a href=\"http://my.host.com/PageRoot\">http://my.host.com/PageRoot</a>", content);
View Full Code Here

    assertSubString("<input type=\"submit\" name=\"submit\" value=\"Create/Replace\"", content);
  }

  @Test
  public void testSymbolicLinkListing() throws Exception {
    WikiPage page = WikiPageUtil.addPage(root, PathParser.parse("SomePage"), "");
    WikiPageUtil.addPage(page, PathParser.parse("SomeChild"), "");
    WikiPage pageOne = WikiPageUtil.addPage(root, PathParser.parse("PageOne"), ""); //...page must exist!
    WikiPageUtil.addPage(pageOne, PathParser.parse("ChildOne"), "");                //...page must exist!

    PageData data = page.getData();
    WikiPageProperties props = data.getProperties();
    WikiPageProperty symProp = props.set(SymbolicPage.PROPERTY_NAME);
View Full Code Here

    assertHasRegexp("<td>\\W*file://some/page\\W*</td>", content);
  }

  @Test
  public void testSymbolicLinkListingForBackwardPath() throws Exception {
    WikiPage page = WikiPageUtil.addPage(root, PathParser.parse("SomePage"), "");
    WikiPage child = WikiPageUtil.addPage(page, PathParser.parse("SomeChild"), "");
    WikiPageUtil.addPage(page, PathParser.parse("OtherChild"), "");

    PageData data = child.getData();
    WikiPageProperties props = data.getProperties();
    WikiPageProperty symProp = props.set(SymbolicPage.PROPERTY_NAME);
    symProp.set("InternalBackPage", "<SomePage.OtherChild");
    page.commit(data);

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.