Details
Description
An alert QA person with a big test suite discovered the following. Perhaps this is not the most critical part of the servlet spec to get right, but it's in there! Note that the original test was for a JSP, but the test seems perfectly valid for any servlet, according to the JavaDoc in the Servlet spec for "setBufferSize".
The test does the following
********************************
illegalStateException is thrown if this method is called after content has
been written, specified in the Java Servlet Pages Specification , Sec 14"
testStrategy="A negative test for ServletResponse.setBufferSize() method.
Invoke setBufferSize method, after the content is written using
ServletOutputStream. Test for IllegalStateException error"
*******************************
The test code is as follows
sos = response.getOutputStream();
sos.println( "in SetBufferSize_1Test servlet" );
try
{ //should IllegalStateException response.setBufferSize( 20 ); sos.println( "SetBufferSize_1Test test FAILED" ); sos.println( " ServletResponse.setBufferSize(20) should have thrown IllegalStateException " ); }catch ( IllegalStateException ise )
{ sos.println( "SetBufferSize_1Test test PASSED" ); } } catch ( IOException e ) {
throw e;
Fixes applied to jetty trunk. Waiting on resolution to
JETTY-141before cross-porting to 6.0-branch.