Package fitnesse.wiki

Examples of fitnesse.wiki.WikiPage.commit()


    WikiPageUtil.addPage(root, PathParser.parse("NormalPage"), "");
    final WikiPage noButtonsPage = WikiPageUtil.addPage(root, PathParser.parse("NoButtonPage"), "");
    for (final String attribute : PageData.NON_SECURITY_ATTRIBUTES) {
      final PageData data = noButtonsPage.getData();
      data.removeAttribute(attribute);
      noButtonsPage.commit(data);
    }

    SimpleResponse response = requestPage("NormalPage");
    assertSubString(">Edit</a>", response.getContent());
    assertSubString(">Search</a>", response.getContent());
View Full Code Here


  public void testImportedPageIndication() throws Exception {
    final WikiPage page = WikiPageUtil.addPage(root, PathParser.parse("SamplePage"));
    final PageData data = page.getData();
    final WikiImportProperty importProperty = new WikiImportProperty("blah");
    importProperty.addTo(data.getProperties());
    page.commit(data);

    final String content = requestPage("SamplePage").getContent();

    assertSubString("<body class=\"imported\">", content);
  }
View Full Code Here

  private WikiPage addTestPage(WikiPage page, String name, String content) {
    WikiPage testPage = WikiPageUtil.addPage(page, PathParser.parse(name), content);
    PageData data = testPage.getData();
    data.setAttribute("Test");
    testPage.commit(data);
    return testPage;
  }

}
View Full Code Here

  private WikiPage addTestPage(WikiPage page, String name, String content) {
    WikiPage testPage = WikiPageUtil.addPage(page, PathParser.parse(name), content);
    PageData data = testPage.getData();
    data.setAttribute("Test");
    testPage.commit(data);
    return testPage;
  }

  private Descriptor forTestSystem(String type) {
    return argThat(new ForTestSystem(type));
View Full Code Here

    WikiPage page = WikiPageUtil.addPage(root, PathParser.parse("TestPage"),
            "!define PATH_SEPARATOR {|}\n" +
                    "!path fitnesse.jar\n" +
                    "!path my.jar");
    PageData data = page.getData();
    page.commit(data);

    String expected = "fitnesse.jar" + "|" + "my.jar";
    assertEquals(expected, new WikiTestPage(page, variableSource).getClassPath().toString());
  }
View Full Code Here

    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;
  }

  public void pageImported(WikiPage page) {
View Full Code Here

  private WikiPage createPageWithContent(String pageContent) throws Exception {
    WikiPage wikiPage = InMemoryPage.makeRoot("wikiPage");
    PageData pageData = wikiPage.getData();
    pageData.setContent(pageContent);
    wikiPage.commit(pageData);
    return wikiPage;
  }

  private Matcher<WikiPage> contentMatches(final String simpleReplacement) {
    return new TypeSafeMatcher<WikiPage>() {
View Full Code Here

    WikiPagePath alpha = PathParser.parse("AlphaAlpha");
    WikiPage page = WikiPageUtil.addPage(root, alpha, "a");

    PageData data = page.getData();
    data.setContent("b");
    page.commit(data);
    assertEquals("b", page.getData().getContent());
  }

  @Test
  public void testSetAttributes() throws Exception {
View Full Code Here

  public void testSimpleVersionTasks() throws Exception {
    WikiPagePath path = PathParser.parse("MyPageOne");
    WikiPage page = WikiPageUtil.addPage(root, path, "old content");
    PageData data = page.getData();
    data.setContent("new content");
    VersionInfo previousVersion = page.commit(data);

    Collection<VersionInfo> versions = page.getVersions();
    assertEquals(1, versions.size());
    assertEquals(true, versions.contains(previousVersion));
View Full Code Here

    WikiPagePath testPagePath = PathParser.parse("TestPage");
    WikiPage testPage = WikiPageUtil.addPage(root, testPagePath, "version1");

    PageData data = testPage.getData();
    data.setAttribute(PageData.LAST_MODIFYING_USER, "Aladdin");
    VersionInfo record = testPage.commit(data);

    assertTrue(record.getName().startsWith("Aladdin"));
  }

  @Test
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.