Package fitnesse.wiki

Examples of fitnesse.wiki.WikiPage


        String result = ParserTestHelper.translateTo(pageOne);
        assertTrue(result.contains("<i>y</i>"));
    }

    @Test public void translatesVariableContentsInLiteralTable() throws Exception {
        WikiPage pageOne = new TestRoot().makePage("PageOne", "!define x {''y''}\n!|${x}|\n");
        String result = ParserTestHelper.translateTo(pageOne);
        assertTrue(!result.contains("<i>y</i>"));
        assertTrue(result.indexOf("''y''", result.indexOf("table")) >= 0);
    }
View Full Code Here


        assertTrue(!result.contains("<i>y</i>"));
        assertTrue(result.indexOf("''y''", result.indexOf("table")) >= 0);
    }

    @Test public void evaluatesVariablesAtCurrentLocation() throws Exception {
        WikiPage pageOne = new TestRoot().makePage("PageOne", "!define x {y}\n${x}\n!define x {z}\n${x}");
        ParserTestHelper.assertTranslatesTo(pageOne,
          "<span class=\"meta\">variable defined: x=y</span>" + HtmlElement.endl + ParserTestHelper.newLineRendered
            + "y" + ParserTestHelper.newLineRendered
            + "<span class=\"meta\">variable defined: x=z</span>" + HtmlElement.endl + ParserTestHelper.newLineRendered
            + "z");
View Full Code Here

            + "<span class=\"meta\">variable defined: x=z</span>" + HtmlElement.endl + ParserTestHelper.newLineRendered
            + "z");
    }

    @Test public void evaluatesNestedVariableDefinition() throws Exception {
        WikiPage pageOne = new TestRoot().makePage("PageOne", "!define x {y}\n!define z {${x}}\n${z}");
        ParserTestHelper.assertTranslatesTo(pageOne,
          "<span class=\"meta\">variable defined: x=y</span>" + HtmlElement.endl + ParserTestHelper.newLineRendered
            + "<span class=\"meta\">variable defined: z=${x}</span>" + HtmlElement.endl + ParserTestHelper.newLineRendered
            + "y");
    }
View Full Code Here

            + "<span class=\"meta\">variable defined: z=${x}</span>" + HtmlElement.endl + ParserTestHelper.newLineRendered
            + "y");
    }

    @Test public void evaluatesForwardNestedVariableDefinition() throws Exception {
        WikiPage pageOne = new TestRoot().makePage("PageOne", "!define z {${x}}\n!define x {y}\n${z}");
        ParserTestHelper.assertTranslatesTo(pageOne,
          "<span class=\"meta\">variable defined: z=${x}</span>" + HtmlElement.endl + ParserTestHelper.newLineRendered +
            "<span class=\"meta\">variable defined: x=y</span>" + HtmlElement.endl + ParserTestHelper.newLineRendered +
            "y");
    }
View Full Code Here

            "<span class=\"meta\">variable defined: x=y</span>" + HtmlElement.endl + ParserTestHelper.newLineRendered +
            "y");
    }

    @Test public void evaluatesEmptyNestedVariableDefinition() throws Exception {
        WikiPage pageOne = new TestRoot().makePage("PageOne", "!define x {}\n!define z {${x}}\n${z}");
        ParserTestHelper.assertTranslatesTo(pageOne,
          "<span class=\"meta\">variable defined: x=</span>" + HtmlElement.endl + ParserTestHelper.newLineRendered +
            "<span class=\"meta\">variable defined: z=${x}</span>" + HtmlElement.endl + ParserTestHelper.newLineRendered);
    }
View Full Code Here

            "<span class=\"meta\">variable defined: z=${x}</span>" + HtmlElement.endl + ParserTestHelper.newLineRendered);
    }

    @Test public void evaluatesVariablesFromParent() throws Exception {
        TestRoot root = new TestRoot();
        WikiPage parent = root.makePage("PageOne", "!define x {y}\n");
        WikiPage child = root.makePage(parent, "PageTwo");
        ParserTestHelper.assertTranslatesTo(child, "${x}", "y");
    }
View Full Code Here

        ParserTestHelper.assertTranslatesTo(child, "${x}", "y");
    }

    @Test public void evaluatesVariablesFromParentInCurrentContext() throws Exception {
        TestRoot root = new TestRoot();
        WikiPage parent = root.makePage("PageOne", "!define x {${y}}\n");
        WikiPage child = root.makePage(parent, "PageTwo", "!define y {stuff}\n${x}");
        assertTrue(ParserTestHelper.translateTo(child).endsWith("stuff"));
    }
View Full Code Here

        assertTrue(ParserTestHelper.translateTo(child).endsWith("stuff"));
    }

    @Test public void evaluatesVariablesFromInclude() throws Exception {
        TestRoot root = new TestRoot();
        WikiPage includer = root.makePage("PageOne", "!include -seamless PageTwo\n${x}");
        root.makePage("PageTwo", "!define x {y}");
        ParserTestHelper.assertTranslatesTo(includer, "<span class=\"meta\">variable defined: x=y</span>" + HtmlElement.endl +
          "y");
    }
View Full Code Here

  private final WikiPagePath level2FullPath = this.level1Path.copy().addNameToEnd(this.level2Name);
  private final String qualifiedLevel2Name = PathParser.render(this.level2FullPath);

  @Test
  public void testDeleteConfirmation() throws Exception {
    WikiPage level1 = WikiPageUtil.addPage(this.root, this.level1Path, "");
    WikiPageUtil.addPage(level1, this.level2Path, "");
    MockRequest request = new MockRequest();
    request.setResource(this.qualifiedLevel2Name);
    request.addInput("deletePage", "");
View Full Code Here

    assertSubString("Are you sure you want to delete " + this.qualifiedLevel2Name, content);
  }

  @Test
  public void testDeletePage() throws Exception {
    WikiPage level1 = WikiPageUtil.addPage(this.root, this.level1Path, "");
    WikiPageUtil.addPage(level1, this.level2Path, "");
    assertTrue(this.root.getPageCrawler().pageExists(this.level1Path));
    MockRequest request = new MockRequest();
    request.setResource(this.level1Name);
    request.addInput("confirmed", "yes");
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.