use of org.apache.tapestry5.test.PageTester in project tapestry-5 by apache.
the class LoopTest method render.
@Test
public void render() {
tester = new PageTester(TestConstants.APP2_PACKAGE, TestConstants.APP2_NAME);
Document doc = tester.renderPage("TestPageForLoop");
assertTrue(doc.toString().contains("abcabcabc"));
assertEquals(doc.getElementById("1").getChildMarkup(), "xyz");
}
use of org.apache.tapestry5.test.PageTester in project tapestry-5 by apache.
the class OverrideMethodsTest method override_abstract_methods.
/**
* TAP5-901
*/
@Test
public void override_abstract_methods() {
PageTester tester = new PageTester(TestConstants.APP2_PACKAGE, TestConstants.APP2_NAME);
try {
Document doc = tester.renderPage("OverrideAbstractMethods");
assertEquals("6", doc.getElementById("length").getChildMarkup());
} finally {
tester.shutdown();
}
}
use of org.apache.tapestry5.test.PageTester in project tapestry-5 by apache.
the class SubmitTest method before.
@BeforeMethod
public void before() {
tester = new PageTester(TestConstants.APP2_PACKAGE, TestConstants.APP2_NAME);
doc = tester.renderPage("TestPageForSubmit");
fieldValues = CollectionFactory.newMap();
}
use of org.apache.tapestry5.test.PageTester in project tapestry-5 by apache.
the class KaptchaUnitTest method cache_control_header.
@SuppressWarnings("unchecked")
@Test
public void cache_control_header() {
PageTester tester = new PageTester("kaptcha.demo", "app");
final TestableResponse response = tester.renderPageAndReturnResponse("KaptchaDemo");
final List<String> headers = (List<String>) response.getHeaders("Cache-Control");
assert "no-store, no-cache, must-revalidate".equals(headers.get(0));
assert "post-check=0, pre-check=0".equals(headers.get(1));
}
Aggregations