hide expected exception in test

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@1003 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Greg Wilkins 2009-10-16 20:32:05 +00:00
parent 3a9a33565b
commit d7b2eab37f
2 changed files with 17 additions and 8 deletions

View File

@ -668,7 +668,6 @@ public class HttpConnection implements Connection
catch(RuntimeException e)
{
Log.warn("header full: "+e);
Log.debug(e);
_response.reset();
_generator.reset(true);

View File

@ -28,6 +28,7 @@ import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.http.HttpHeaders;
import org.eclipse.jetty.http.MimeTypes;
import org.eclipse.jetty.util.log.Log;
import junit.framework.TestCase;
@ -313,13 +314,22 @@ public class HttpConnectionTest extends TestCase
{
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
baseRequest.setHandled(true);
response.setHeader(HttpHeaders.CONTENT_TYPE,MimeTypes.TEXT_HTML);
response.setHeader("LongStr", longstr);
PrintWriter writer = response.getWriter();
writer.write("<html><h1>FOO</h1></html>");
writer.flush();
writer.close();
try
{
baseRequest.setHandled(true);
response.setHeader(HttpHeaders.CONTENT_TYPE,MimeTypes.TEXT_HTML);
response.setHeader("LongStr", longstr);
PrintWriter writer = response.getWriter();
writer.write("<html><h1>FOO</h1></html>");
writer.flush();
writer.close();
throw new RuntimeException("SHOULD NOT GET HERE");
}
catch(ArrayIndexOutOfBoundsException e)
{
Log.debug(e);
Log.info("correctly ignored "+e);
}
}
});
server.start();