Package fitnesse.wiki

Examples of fitnesse.wiki.WikiPage


    assertSubString("<a href=\".SomePage.OtherChild\">&lt;SomePage.OtherChild</a>", content);
  }

  @Test
  public void testPageTypePropertiesHtml() throws Exception {
    WikiPage page = WikiPageUtil.addPage(root, PathParser.parse("SomePage"));
    PageData data = page.getData();
    SimpleResponse response = (SimpleResponse) new PropertiesResponder().makeResponse(context, request);
    String html = response.getContent();
    assertSubString("Page type:", html);
    assertSubString("<input type=\"radio\" id=\"Static\" name=\"PageType\" value=\"Static\" checked=\"checked\"/>", html);
    assertSubString("<input type=\"radio\" id=\"Test\" name=\"PageType\" value=\"Test\"/>", html);
View Full Code Here


    assertSubString("<input type=\"checkbox\" id=\"Prune\" name=\"Prune\"/>", html);
  }

  @Test
  public void testPageTypePropertiesSuiteHtml() throws Exception {
    WikiPage page = WikiPageUtil.addPage(root, PathParser.parse("SomePage"));
    PageData data = page.getData();
    data.setAttribute("Suite");
    page.commit(data);
    assertEquals(page, context.root.getPageCrawler().getPage(PathParser.parse(".SomePage")));
    request.setResource(page.getPageCrawler().getFullPath().toString());
    SimpleResponse response = (SimpleResponse) new PropertiesResponder().makeResponse(context, request);
    String html = response.getContent();
    assertSubString("Page type:", html);
    assertSubString("<input type=\"radio\" id=\"Static\" name=\"PageType\" value=\"Static\"/>", html);
    assertSubString("<input type=\"radio\" id=\"Test\" name=\"PageType\" value=\"Test\"/>", html);
View Full Code Here

    assertSubString("<input type=\"checkbox\" id=\"Prune\" name=\"Prune\"/>", html);
  }

  @Test
  public void testPageTypePropertiesTestHtml() throws Exception {
    WikiPage page = WikiPageUtil.addPage(root, PathParser.parse("SomePage"));
    PageData data = page.getData();
    data.setAttribute("Test");
    page.commit(data);
    request.setResource(page.getPageCrawler().getFullPath().toString());
    SimpleResponse response = (SimpleResponse) new PropertiesResponder().makeResponse(context, request);
    String html = response.getContent();
    assertSubString("Page type:", html);
    assertSubString("<input type=\"radio\" id=\"Static\" name=\"PageType\" value=\"Static\"/>", html);
    assertSubString("<input type=\"radio\" id=\"Test\" name=\"PageType\" value=\"Test\" checked=\"checked\"/>", html);
View Full Code Here

    assertSubString("<input type=\"checkbox\" id=\"Prune\" name=\"Prune\"/>", html);
  }

  @Test
  public void testPageTypePropertiesSkippedHtml() throws Exception {
    WikiPage page = WikiPageUtil.addPage(root, PathParser.parse("SomePage"));
    PageData data = page.getData();
    data.setAttribute("Prune");
    page.commit(data);
    request.setResource(page.getPageCrawler().getFullPath().toString());
    SimpleResponse response = (SimpleResponse) new PropertiesResponder().makeResponse(context, request);
    String html = response.getContent();
    assertSubString("Page type:", html);
    assertSubString("<input type=\"checkbox\" id=\"Prune\" name=\"Prune\" checked=\"checked\"/>", html);
  }
View Full Code Here

    assertSubString("<input type=\"text\" id=\"Suites\" title=\"Separate tags by a comma\" name=\"Suites\" value=\"\"", content);
  }

  @Test
  public void testSuitesDisplayed() throws Exception {
    WikiPage page = getContentFromSimplePropertiesPage();
    PageData data = page.getData();
    data.setAttribute(PageData.PropertySUITES, "smoke");
    page.commit(data);

    getPropertiesContentFromPage(page);

    assertSubString("Suites", content);
    assertSubString("<input type=\"text\" id=\"Suites\" title=\"Separate tags by a comma\" name=\"Suites\" value=\"smoke\"", content);
View Full Code Here

  @Before
  public void setUp() throws Exception {
    root = InMemoryPage.makeRoot("RooT");
    FitNesseContext context = FitNesseUtil.makeTestContext(root);
    WikiPageUtil.addPage(root, PathParser.parse("PageOne"), "PageOne");
    WikiPage pageTwo = WikiPageUtil.addPage(root, PathParser.parse("PageTwo"), "PageOne");
    WikiPageUtil.addPage(pageTwo, PathParser.parse("ChildPage"), ".PageOne");
  }
View Full Code Here

    responder = new EditResponder();
  }

  @Test
  public void testResponse() throws Exception {
    WikiPage page= WikiPageUtil.addPage(root, PathParser.parse("ChildPage"), "child content with <html>");
    PageData data = page.getData();
    WikiPageProperties properties = data.getProperties();
    properties.set(PageData.PropertySUITES, "Edit Page tags");
    page.commit(data);

    SimpleResponse response = makeResponse();
    assertEquals(200, response.getStatus());

    String body = response.getContent();
View Full Code Here

    FitnesseFixtureContext.root = InMemoryPage.makeRoot("root");
  }

  @Test
  public void testCreatePage() throws Exception {
    WikiPage testPage = makePage("TestPage", "contents", "attr=val");
    assertNotNull(testPage);
    PageData data = testPage.getData();
    assertEquals("contents", data.getContent());
    assertEquals("val", data.getAttribute("attr"));
  }
View Full Code Here

    PageCreator creator = new PageCreator();
    creator.setPageName(pageName);
    creator.setPageContents(pageContent);
    creator.setPageAttributes(pageAttributes);
    assertTrue(creator.valid());
    WikiPage testPage = FitnesseFixtureContext.root.getChildPage("TestPage");
    return testPage;
  }
View Full Code Here

    return testPage;
  }

  @Test
  public void testMultipleAttributes() throws Exception {
    WikiPage testPage = makePage("TestPage", "Contents", "att1=one,att2=two");
    PageData data = testPage.getData();
    assertEquals("one", data.getAttribute("att1"));
    assertEquals("two", data.getAttribute("att2"));
  }
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.