use of org.apache.tapestry5.test.PageTester 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.test.PageTester in project tapestry-5 by apache.
the class ASOTest method submit_aso.
@Test
public void submit_aso() {
tester = new PageTester(TestConstants.APP2_PACKAGE, TestConstants.APP2_NAME);
Document doc = tester.renderPage("TestPageForASO");
assertTrue(doc.toString().contains("bar"));
}
use of org.apache.tapestry5.test.PageTester in project tapestry-5 by apache.
the class PageTesterModule method setupTestableOverrides.
@Contribute(ServiceOverride.class)
public static void setupTestableOverrides(MappedConfiguration<Class, Object> configuration, @Local TestableRequest request, @Local TestableResponse response, final ObjectLocator locator) {
configuration.add(Request.class, request);
configuration.add(Response.class, response);
TestableCookieSinkSource cookies = new TestableCookieSinkSource();
configuration.add(CookieSink.class, cookies);
configuration.add(CookieSource.class, cookies);
// With the significant changes to the handling of assets in 5.4, we introduced a problem:
// We were checking at page render time whether to generate URLs for normal or compressed
// assets and that peeked at the HttpServletRequest global, which isn't set up by PageTester.
// What we're doing here is using a hacked version of that code to force GZip support
// on.
configuration.add(ResponseCompressionAnalyzer.class, new ResponseCompressionAnalyzer() {
public boolean isGZipEnabled(ContentType contentType) {
return locator.getObject(CompressionAnalyzer.class, null).isCompressable(contentType.getMimeType());
}
public boolean isGZipSupported() {
return true;
}
});
}
use of org.apache.tapestry5.test.PageTester in project tapestry-5 by apache.
the class PageTesterTest method setupRequestFromURI_accepts_query_strings.
@Test
public void setupRequestFromURI_accepts_query_strings() {
PageTester pageTester = new PageTester("org.example.app1", "app1");
pageTester.setupRequestFromURI("/foo/somePage?param=value");
}
use of org.apache.tapestry5.test.PageTester in project tapestry5-hotel-booking by ccordenier.
the class BaseUnitTestSuite method setup.
@BeforeClass
public void setup() {
pageTester = new PageTester("com.tap5.hotelbooking", "hotel-booking", "src/main/webapp");
registry = pageTester.getRegistry();
}
Aggregations