public void testAbstractMethodError() throws Exception
{
HttpServletRequest request = newMock(HttpServletRequest.class);
HttpServletResponse response = newResponse();
ServletRequestServicer servicer = newServicer();
Throwable t = new AbstractMethodError();
expect(request.getCharacterEncoding()).andReturn(null);
request.setCharacterEncoding("output-encoding");
expectLastCall().andThrow(t);
servicer.service(request, response);
replay();
SetupRequestEncoding sre = new SetupRequestEncoding();
sre.setOutputEncoding("output-encoding");
sre.service(request, response, servicer);
verify();
// Check that, after such an error, we don't even try to do it again.
servicer.service(request, response);
replay();
sre.service(request, response, servicer);