use of org.apache.tapestry5.dom.Document in project tapestry-5 by apache.
the class DTDTest method verify_correct_dtds.
@Test(dataProvider = "dtd_page_provider")
public void verify_correct_dtds(String pageName, String expectedDTD, String checkText) {
PageTester tester = new PageTester(TestConstants.APP2_PACKAGE, TestConstants.APP2_NAME);
Document doc = tester.renderPage(pageName);
String txt = doc.toString();
// use startsWith to make sure the DTD is getting into the right spot.
assertTrue(txt.startsWith(expectedDTD));
// we should also make sure that the other DTD's don't appear anywhere else...
checkOtherDTD(txt, expectedDTD);
// spot check the body of the pages to make sure they correctly rendered...
// they should have, based on the unit tests for template rendering, but...
assertTrue(txt.contains(checkText));
}
use of org.apache.tapestry5.dom.Document in project tapestry-5 by apache.
the class HeadTest method display.
@Test
public void display() {
tester = new PageTester(TestConstants.APP2_PACKAGE, TestConstants.APP2_NAME);
Document doc = tester.renderPage("TestPageForHead");
assertTrue(doc.toString().contains("OK"));
}
use of org.apache.tapestry5.dom.Document in project tapestry-5 by apache.
the class LocaleTest method prefer_canada_french.
@Test
public void prefer_canada_french() {
tester.setPreferedLanguage(Locale.CANADA_FRENCH);
Document doc = tester.renderPage("TestPageForLocale");
assertEquals(doc.getElementById("id1").getChildMarkup(), "French page");
}
use of org.apache.tapestry5.dom.Document in project tapestry-5 by apache.
the class LocaleTest method change_language_in_browser.
@Test
public void change_language_in_browser() {
tester.setPreferedLanguage(Locale.ENGLISH);
Document doc = tester.renderPage("TestPageForLocale");
assertEquals(doc.getElementById("id1").getChildMarkup(), "English page");
tester.setPreferedLanguage(Locale.CANADA_FRENCH);
doc = tester.renderPage("TestPageForLocale");
assertEquals(doc.getElementById("id1").getChildMarkup(), "French page");
}
use of org.apache.tapestry5.dom.Document in project tapestry-5 by apache.
the class LocaleTest method no_preferred_language.
@Test
public void no_preferred_language() {
Document doc = tester.renderPage("TestPageForLocale");
assertEquals(doc.getElementById("id1").getChildMarkup(), "English page");
}
Aggregations