Package fitnesse.wiki

Examples of fitnesse.wiki.WikiPagePath


  private WikiPage addLocalPageWithImportProperty(WikiPage parentPage, String pageName, boolean isRoot) throws Exception {
    WikiPage page = parentPage.addChildPage(pageName);
    PageData data = page.getData();

    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);
View Full Code Here


    }
  }

  private HtmlPage makeHtml() {
    PageCrawler pageCrawler = page.getPageCrawler();
    WikiPagePath fullPath = pageCrawler.getFullPath();
    String fullPathName = PathParser.render(fullPath);
    HtmlPage htmlPage = context.pageFactory.newPage();
    htmlPage.setTitle(getTitle() + ": " + fullPathName);
    htmlPage.setPageTitle(new PageTitle(getTitle(), fullPath, data.getAttribute(PageData.PropertySUITES)));
    htmlPage.setNavTemplate("testNav.vm");
View Full Code Here

    return content;
  }

  private WikiPage getParentWikiPage(FitNesseContext context, Request request) {
    //the request resource is already th parent path.
    WikiPagePath parentPath = PathParser.parse(request.getResource());

    //we need a pageBuilder to get the page from the path. The root has a pageBuilder we can use.
    PageCrawler crawler = context.root.getPageCrawler();
    WikiPage page = crawler.getPage(parentPath);
    return page;
View Full Code Here

  }

  public Response makeResponse(FitNesseContext context, Request request) {
    SimpleResponse response = new SimpleResponse();
    resource = this.request.getResource();
    WikiPagePath path = PathParser.parse(resource);
    WikiPage page = context.root.getPageCrawler().getPage(path);
    existingContent = page.getData().getContent();
    newContent = (String) this.request.getInput(EditResponder.CONTENT_INPUT_NAME);

    response.setContent(makePageHtml(context));
View Full Code Here

    return WikiPageProperty.getTimeFormat().format(modificationTime.getTime());
  }

  @Test
  public void testGetContent() throws Exception {
    WikiPagePath alpha = PathParser.parse("AlphaAlpha");
    WikiPage a = WikiPageUtil.addPage(root, alpha, "a");

    PageData data = a.getData();
    assertEquals("a", data.getContent());
  }
View Full Code Here

    assertEquals("a", data.getContent());
  }

  @Test
  public void testReplaceContent() throws Exception {
    WikiPagePath alpha = PathParser.parse("AlphaAlpha");
    WikiPage page = WikiPageUtil.addPage(root, alpha, "a");

    PageData data = page.getData();
    data.setContent("b");
    page.commit(data);
View Full Code Here

    assertEquals("true", root.getData().getAttribute("Test"));
  }

  @Test
  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);
View Full Code Here

    assertEquals("old content", loadedPage.getData().getContent());
  }

  @Test
  public void testUserNameIsInVersionName() throws Exception {
    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);
View Full Code Here

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

  @Test
  public void testNoVersionException() throws Exception {
    WikiPagePath pageOnePath = PathParser.parse("PageOne");
    WikiPage page = WikiPageUtil.addPage(root, pageOnePath, "old content");
    try {
      page.getVersion("abc");
      fail("a NoSuchVersionException should have been thrown");
    } catch (NoSuchVersionException e) {
View Full Code Here

  @Test
  public void externalPageShouldBeAChildOfSuite() throws IOException {
    fileSystem.makeFile(new File("somewhere/MyTest/myfile.html"), "stuff");
    ExternalSuitePage suite = new ExternalSuitePage(new File("somewhere", "MyTest"), "MyTest", rootPage, fileSystem, variableSource);
    ExternalTestPage testPage = (ExternalTestPage) suite.getChildren().get(0);
    WikiPagePath path = testPage.getPageCrawler().getFullPath();
    assertEquals("Page path for external file", "MyTest.myfile", path.toString());
  }
View Full Code Here

TOP

Related Classes of fitnesse.wiki.WikiPagePath

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.