Search in sources :

Example 86 with Response

use of org.apache.tapestry5.services.Response 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));
}
Also used : PageTester(org.apache.tapestry5.test.PageTester) TestableResponse(org.apache.tapestry5.internal.test.TestableResponse) List(java.util.List) Test(org.junit.Test)

Aggregations

Test (org.testng.annotations.Test)53 Response (org.apache.tapestry5.http.services.Response)47 Request (org.apache.tapestry5.http.services.Request)25 Link (org.apache.tapestry5.http.Link)23 HttpServletResponse (javax.servlet.http.HttpServletResponse)16 LocalizationSetter (org.apache.tapestry5.services.LocalizationSetter)12 MetaDataLocator (org.apache.tapestry5.services.MetaDataLocator)12 ComponentClassResolver (org.apache.tapestry5.services.ComponentClassResolver)11 PageRenderRequestParameters (org.apache.tapestry5.services.PageRenderRequestParameters)11 EmptyEventContext (org.apache.tapestry5.internal.EmptyEventContext)9 HttpServletRequest (javax.servlet.http.HttpServletRequest)8 RequestFilter (org.apache.tapestry5.http.services.RequestFilter)8 RequestHandler (org.apache.tapestry5.http.services.RequestHandler)8 JSONObject (org.apache.tapestry5.json.JSONObject)8 Context (org.apache.tapestry5.http.services.Context)7 Dispatcher (org.apache.tapestry5.http.services.Dispatcher)7 ComponentEventLinkEncoder (org.apache.tapestry5.services.ComponentEventLinkEncoder)7 ComponentEventRequestParameters (org.apache.tapestry5.services.ComponentEventRequestParameters)6 ComponentRequestHandler (org.apache.tapestry5.services.ComponentRequestHandler)6 IOException (java.io.IOException)5