assertEquals("forwarded to failed", "failed0.jsp", response.getForwardedUrl());
assertTrue("Exception exposed", request.getAttribute("exception").getClass().equals(ServletException.class));
}
public void testAnotherLocaleRequest() throws Exception {
MockHttpServletRequest request = new MockHttpServletRequest(getServletContext(), "GET", "/locale.do;abc=def");
request.addPreferredLocale(Locale.CANADA);
request.addUserRole("role1");
MockHttpServletResponse response = new MockHttpServletResponse();
complexDispatcherServlet.service(request, response);
assertTrue("Not forwarded", response.getForwardedUrl() == null);
assertTrue(request.getAttribute("test1") != null);
assertTrue(request.getAttribute("test1x") == null);
assertTrue(request.getAttribute("test1y") == null);
assertTrue(request.getAttribute("test2") != null);
assertTrue(request.getAttribute("test2x") == null);
assertTrue(request.getAttribute("test2y") == null);
assertTrue(request.getAttribute("test3") != null);
assertTrue(request.getAttribute("test3x") != null);
assertTrue(request.getAttribute("test3y") != null);
assertEquals("99", response.getHeader("Last-Modified"));
}