Package fitnesse.wiki

Examples of fitnesse.wiki.PageData


  @Test
  public void testImportedPageIndication() throws Exception {
    pageRenderingSetUp();

    page = WikiPageUtil.addPage(root, PathParser.parse("SamplePage"));
    PageData data = page.getData();
    WikiImportProperty importProperty = new WikiImportProperty("blah");
    importProperty.addTo(data.getProperties());
    page.commit(data);

    String content = getContentAfterSpecialImportHandling();

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


  @Test
  public void testEditActions() throws Exception {
    pageRenderingSetUp();

    page = WikiPageUtil.addPage(root, PathParser.parse("SamplePage"));
    PageData data = page.getData();
    page.commit(data);
    String content = getContentAfterSpecialImportHandling();

    assertNotSubString("Edit Locally", content);
    assertNotSubString("Edit Remotely", content);

    WikiImportProperty importProperty = new WikiImportProperty("blah");
    importProperty.addTo(data.getProperties());
    page.commit(data);
    content = getContentAfterSpecialImportHandling();

    assertTrue(WikiImportProperty.isImportedSubWiki(data));
    assertSubString("<a href=\"SamplePage?edit\" accesskey=\"e\">Edit Locally</a>", content);
View Full Code Here

    assertEquals("somePath", classPath);
  }

  private String makeClassPathFromSimpleStructure(String path) throws Exception {
    PageData data = root.getData();
    data.setContent("!path " + path);
    root.commit(data);
    PageCrawler crawler = root.getPageCrawler();
    WikiPage page = crawler.getPage(somePagePath, new MockingPageCrawler());
    List<String> classPath = builder.getClassPath(page);
    return StringUtils.join(classPath, System.getProperty("path.separator"));
View Full Code Here

    WikiPage page = WikiPageUtil.addPage(root, PathParser.parse("ClassPath"), "!define PATH {/my/path}\n!path ${PATH}.jar");
    List<String> paths = builder.getClassPath(page);
    assertEquals("/my/path.jar", paths.get(0));

    PageData data = root.getData();
    data.setContent("!define PATH {/my/path}\n");
    root.commit(data);

    page = WikiPageUtil.addPage(root, PathParser.parse("ClassPath2"), "!path ${PATH}.jar");
    paths = builder.getClassPath(page);
    assertEquals("/my/path.jar", paths.get(0));
View Full Code Here

  @Before
  public void setUp() throws Exception {
    root = InMemoryPage.makeRoot("RooT");
    WikiPageUtil.addPage(root, PathParser.parse("TestPageOne"), "TestPageOne has some testing content and a child");
    WikiPage child = WikiPageUtil.addPage(root, PathParser.parse("TestPageOne.ChildPage"), "ChildPage is a child of TestPageOne");
    PageData data = child.getData();
    data.setAttribute("Test");
    child.commit(data);
    WikiPageUtil.addPage(root, PathParser.parse("TestPageTwo"), "TestPageTwo has a bit of content too");
    runner = new SuiteSpecificationRunner(root);
  }
View Full Code Here

  }

  @Test
  public void shouldntIncludeSuitesInThePageList() throws Exception {
    WikiPage testSuitePage = WikiPageUtil.addPage(root, PathParser.parse("SuitePageOne"));
    PageData data = testSuitePage.getData();
    data.setAttribute("Suite");
    testSuitePage.commit(data);
    String page = "<table><tr><td>Suite</td></tr><tr><td>Title</td><td>One</td></tr><tr><td>Content</td><td></td></tr></table>";
    assertTrue(runner.getPageListFromPageContent(page));
    assertEquals(1,runner.testPageList.size());
  }
View Full Code Here

    return responder.makeResponse(context, request);
  }

  @Test
  public void testPageContentIsUpdated() throws Exception {
    PageData data = testData.pageTwo.getData();
    WikiPageProperties props = data.getProperties();

    WikiImportProperty importProps = new WikiImportProperty("http://localhost:" + FitNesseUtil.PORT + "/PageTwo");
    importProps.addTo(props);
    testData.pageTwo.commit(data);

    getResponse();

    data = testData.pageTwo.getData();
    assertEquals("page two", data.getContent());
  }
View Full Code Here

  private void doSimpleRunWithTags(String fixtureTable, String tags) throws Exception {
    if (debug) request.addInput("debug", "true");
    String simpleRunPageName = "TestPage";
    testPage = WikiPageUtil.addPage(root, PathParser.parse(simpleRunPageName), classpathWidgets() + fixtureTable);
    if (tags != null) {
      PageData pageData = testPage.getData();
      pageData.setAttribute(PageData.PropertySUITES, tags);
      testPage.commit(pageData);
    }
    request.addInput("requestParam", "2");
    request.setResource(testPage.getName());
View Full Code Here

    results = sender.sentData();
  }

  @Test
  public void testEmptyTestPage() throws Exception {
    PageData data = root.getData();
    data.setContent(classpathWidgets());
    root.commit(data);
    testPage = WikiPageUtil.addPage(root, PathParser.parse("EmptyTestPage"), "");
    request.setResource(testPage.getName());

    response = responder.makeResponse(context, request);
View Full Code Here

    WikiPage suitePage = WikiPageUtil.addPage(root, PathParser.parse("TestSuite"), classpathWidgets());
    WikiPage testPage = WikiPageUtil.addPage(suitePage, PathParser.parse("TestPage"), outputWritingTable("Output of TestPage"));
    WikiPageUtil.addPage(suitePage, PathParser.parse(PageData.SUITE_SETUP_NAME), outputWritingTable("Output of SuiteSetUp"));
    WikiPageUtil.addPage(suitePage, PathParser.parse(PageData.SUITE_TEARDOWN_NAME), outputWritingTable("Output of SuiteTearDown"));

    PageData data = testPage.getData();
    WikiPageProperties properties = data.getProperties();
    properties.set(PageData.PropertySUITES, "Test Page tags");
    testPage.commit(data);

    WikiPagePath testPagePath = testPage.getPageCrawler().getFullPath();
    String resource = PathParser.render(testPagePath);
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.