Package fitnesse.wiki

Examples of fitnesse.wiki.WikiPage


    @Test
    public void imageWithBorder() throws Exception {
        ParserTestHelper.assertParses("!img -b 1 name", "SymbolList[Link[SymbolList[Text]]]");
        TestRoot root = new TestRoot();
        WikiPage testPage = root.makePage("ImagePage", "!img -b 1 name");
        ParserTestHelper.assertTranslatesTo(testPage, "<img src=\"name\" style=\"border:1px solid black;\"/>");
    }
View Full Code Here


    @Test
    public void imageWithMarginBorderWidth() throws Exception {
        ParserTestHelper.assertParses("!img -b 1 name", "SymbolList[Link[SymbolList[Text]]]");
        TestRoot root = new TestRoot();
        WikiPage testPage = root.makePage("ImagePage", "!img -m 5 -b 1 -w 50 name");
        ParserTestHelper.assertTranslatesTo(testPage, "<img src=\"name\" width=\"50\" style=\"border:1px solid black;margin:5px 5px 5px 5px;\"/>");
    }
View Full Code Here

    String user = root.getChildPage("EditPage").getData().getAttribute(PageData.LAST_MODIFYING_USER);
    assertEquals("Aladdin", user);
  }

  private void createAndSaveANewPage(String pageName) throws Exception {
    WikiPage simplePage = WikiPageUtil.addPage(root, PathParser.parse(pageName));

    PageData data = simplePage.getData();
    SaveRecorder.pageSaved(simplePage, 0);
    simplePage.commit(data);
  }
View Full Code Here

  }

  @Test
  public void evaluatesVariablesInLink() throws Exception {
    TestRoot root = new TestRoot();
    WikiPage page = root.makePage("PageOne", "[[tag][PageTwo${x}]]");
    root.makePage("PageTwo3", "hi");
    ParserTestHelper.assertTranslatesTo(page, new TestVariableSource("x", "3"), link("tag", "PageTwo3"));
  }
View Full Code Here

  }

  @Test
  public void evaluatesLowercaseLink() throws Exception {
    TestRoot root = new TestRoot();
    WikiPage parent = root.makePage("parent", "[[tag][other_page]]");
    WikiPage page1 = root.makePage(parent, "page", "[[tag][other_page]]");
    root.makePage(parent, "other_page", "hi");
    ParserTestHelper.assertTranslatesTo(page1, link("tag", "parent.other_page"));
  }
View Full Code Here

        ParserTestHelper.assertParses("!see ya", "SymbolList[Text, Whitespace, Text]");
    }

    @Test public void translatesSees() throws Exception{
        TestRoot root = new TestRoot();
        WikiPage page = root.makePage("PageOne", "!see PageTwo");
        root.makePage("PageTwo", "hi");
        ParserTestHelper.assertTranslatesTo(page, "<b>See: <a href=\"PageTwo\">PageTwo</a></b>");
    }
View Full Code Here

  }


  @Test
  public void buildDefaultTestSystemName() throws Exception {
    WikiPage testPage = WikiPageUtil.addPage(root, PathParser.parse("TestPage"), "");
    WikiPageDescriptor descriptor = new WikiPageDescriptor(testPage, false, false, "");
    MockClientBuilder clientBuilder = new MockClientBuilder(descriptor);
    String testSystemName = clientBuilder.getTestSystemName();
    assertEquals("fit:" + MOCK_TEST_RUNNER, testSystemName);
  }
View Full Code Here

    assertEquals("fit:" + MOCK_TEST_RUNNER, testSystemName);
  }

  @Test
  public void buildTestSystemNameWhenTestSystemIsSlim() throws Exception {
    WikiPage testPage = WikiPageUtil.addPage(root, PathParser.parse("TestPage"), "!define TEST_SYSTEM {slim}\n");
    WikiPageDescriptor descriptor = new WikiPageDescriptor(testPage, false, false, "");
    MockClientBuilder clientBuilder = new MockClientBuilder(descriptor);
    String testSystemName = clientBuilder.getTestSystemName();
    assertEquals("slim:" + MOCK_TEST_RUNNER, testSystemName);
  }
View Full Code Here

    assertEquals("slim:" + MOCK_TEST_RUNNER, testSystemName);
  }

  @Test
  public void buildTestSystemNameWhenTestSystemIsUnknownDefaultsToFit() throws Exception {
    WikiPage testPage = WikiPageUtil.addPage(root, PathParser.parse("TestPage"), "!define TEST_SYSTEM {X}\n");
    WikiPageDescriptor descriptor = new WikiPageDescriptor(testPage, false, false, "");
    MockClientBuilder clientBuilder = new MockClientBuilder(descriptor);
    String testSystemName = clientBuilder.getTestSystemName();
    assertEquals("X:" + MOCK_TEST_RUNNER, testSystemName);
  }
View Full Code Here

    assertEquals("X:" + MOCK_TEST_RUNNER, testSystemName);
  }

  @Test
  public void buildFullySpecifiedTestSystemName() throws Exception {
    WikiPage testPage = WikiPageUtil.addPage(root, PathParser.parse("TestPage"),
            "!define TEST_SYSTEM {system}\n" +
                    "!define TEST_RUNNER {runner}\n");
    WikiPageDescriptor descriptor = new WikiPageDescriptor(testPage, false, false, "");
    MockClientBuilder clientBuilder = new MockClientBuilder(descriptor);
    String testSystemName = clientBuilder.getTestSystemName();
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.