Package fitnesse.wiki

Examples of fitnesse.wiki.WikiPage


    request.addInput("linkPath", "PageTwo");
    Response response = invokeResponder();

    checkPageOneRedirectToProperties(response);

    WikiPage symLink = pageOne.getChildPage("SymTwo");
    assertNotNull(symLink);
    assertEquals(SymbolicPage.class, symLink.getClass());
  }
View Full Code Here


    request.addInput("linkPath", "<PageTwo.ChildThree");
    Response response = invokeResponder();

    checkChildTwoRedirectToProperties(response);

    WikiPage symLink = childTwo.getChildPage("SymLink");
    assertNotNull(symLink);
    assertEquals(SymbolicPage.class, symLink.getClass());
  }
View Full Code Here

    assertSubString("Error Occured", content);
  }

  @Test
  public void testAddFailWhenLinkPathIsInvalid() throws Exception {
    WikiPage symlink = WikiPageUtil.addPage(pageOne, PathParser.parse("SymLink"));

    request.addInput("linkName", "SymLink");
    request.addInput("linkPath", "PageOne PageTwo");
    Response response = invokeResponder();
View Full Code Here

    assertSubString("WikiWord", content);
  }

  @Test
  public void testAddFailWhenPageAlreadyHasChild() throws Exception {
    WikiPage symlink = WikiPageUtil.addPage(pageOne, PathParser.parse("SymLink"), "");

    request.addInput("linkName", "SymLink");
    request.addInput("linkPath", "PageTwo");
    Response response = invokeResponder();
View Full Code Here

    request.addInput("linkPath", "file:/somedir/ExternalRoot");
    Response response = invokeResponder();

    checkPageOneRedirectToProperties(response);

    WikiPage symLink = pageOne.getChildPage("SymLink");
    assertNotNull(symLink);
    assertEquals(SymbolicPage.class, symLink.getClass());

    WikiPage realPage = ((SymbolicPage) symLink).getRealPage();
    assertEquals(FileSystemPage.class, realPage.getClass());
    assertEquals(new File("/somedir/ExternalRoot"), ((FileSystemPage) realPage).getFileSystemPath());
  }
View Full Code Here

    @Test public void definesTable() {
        assertTranslatesDefine("!define x {|a|b|c|}", "x=|a|b|c|");
    }

    @Test public void definesTwoTables()  {
        WikiPage pageOne = new TestRoot().makePage("PageOne");
        ParserTestHelper.assertTranslatesTo(pageOne,
                "!define x {|a|b|c|}\n!define y {|d|e|f|}",
                MakeDefinition("x=|a|b|c|") + HtmlElement.endl + "<br/>"
                + MakeDefinition("y=|d|e|f|")+ HtmlElement.endl);
    }
View Full Code Here

  public void CopiesSymbolValueWhenParsed() {
    assertDefinesValue("!define y {yvalue}\n!define x y\n", "x", "yvalue");
  }

    private void assertDefinesValue(String input, String name, String definedValue) {
        WikiPage pageOne = new TestRoot().makePage("PageOne", input);
        ParsingPage page = new ParsingPage(new WikiSourcePage(pageOne));
        Parser.make(page, input).parse();
        assertEquals(definedValue, page.findVariable(name).getValue());
    }
View Full Code Here

        Parser.make(page, input).parse();
        assertEquals(definedValue, page.findVariable(name).getValue());
    }

    private void assertTranslatesDefine(String input, String definition) {
        WikiPage pageOne = new TestRoot().makePage("PageOne");
        ParserTestHelper.assertTranslatesTo(pageOne, input, MakeDefinition(definition) + HtmlElement.endl);
    }
View Full Code Here

    @Test
    public void assertBuildsSymbolicLinkSuffix() throws Exception{
        Symbol contents = new Symbol(new Contents());
        contents.add(new Symbol(SymbolType.Text, "-p"));

        WikiPage root = InMemoryPage.makeRoot("RooT");
        WikiPage pageOne = WikiPageUtil.addPage(root, PathParser.parse("PageOne"), "page one");
        WikiPage pageOneChild = WikiPageUtil.addPage(pageOne, PathParser.parse("PageOne.PageOneChild"), "page one child");

        // Make Symbolic Link at root that links to PageOne.PageOneChild.
        SymbolicPage symPage = new SymbolicPage("SymPage", pageOneChild, root);
        PageData data = root.getData();
        data.getProperties().set(SymbolicPage.PROPERTY_NAME).set("SymPage", "PageOne.PageOneChild");
View Full Code Here

  public static String translateTo(SourcePage page) throws Exception {
    return new HtmlTranslator(page, new ParsingPage(page)).translateTree(Parser.make(new ParsingPage(page), page.getContent()).parse());
  }

  public static void assertParses(String input, String expected) throws Exception {
    WikiPage page = new TestRoot().makePage("TestPage", input);
    Symbol result = parse(page, input);
    assertEquals(expected, serialize(result));
  }
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.