fixed bad merge

This commit is contained in:
Greg Wilkins 2016-03-02 17:32:07 +01:00
parent eba2bffefe
commit 2b67e04861
1 changed files with 11 additions and 5 deletions

View File

@ -34,6 +34,7 @@ import javax.servlet.AsyncContext;
import javax.servlet.AsyncEvent; import javax.servlet.AsyncEvent;
import javax.servlet.AsyncListener; import javax.servlet.AsyncListener;
import javax.servlet.DispatcherType; import javax.servlet.DispatcherType;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.ServletRequestWrapper; import javax.servlet.ServletRequestWrapper;
import javax.servlet.ServletResponseWrapper; import javax.servlet.ServletResponseWrapper;
@ -45,6 +46,8 @@ import javax.servlet.http.HttpServletResponseWrapper;
import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.DebugListener; import org.eclipse.jetty.server.DebugListener;
import org.eclipse.jetty.server.Dispatcher;
import org.eclipse.jetty.server.HttpChannel;
import org.eclipse.jetty.server.QuietServletException; import org.eclipse.jetty.server.QuietServletException;
import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.RequestLog; import org.eclipse.jetty.server.RequestLog;
@ -117,7 +120,6 @@ public class AsyncServletTest
context.setErrorHandler(_errorHandler); context.setErrorHandler(_errorHandler);
_errorHandler.addErrorPage(300,599,"/error/custom"); _errorHandler.addErrorPage(300,599,"/error/custom");
_servletHandler=context.getServletHandler(); _servletHandler=context.getServletHandler();
ServletHolder holder=new ServletHolder(_servlet); ServletHolder holder=new ServletHolder(_servlet);
holder.setAsyncSupported(true); holder.setAsyncSupported(true);
@ -199,7 +201,7 @@ public class AsyncServletTest
@Test @Test
public void testAsyncNotSupportedAsync() throws Exception public void testAsyncNotSupportedAsync() throws Exception
{ {
((StdErrLog)getLogger(ServletHandler.class)).setHideStacks(true); ((StdErrLog)getLogger(HttpChannel.class)).setHideStacks(true);
try try
{ {
_expectedCode="500 "; _expectedCode="500 ";
@ -207,16 +209,18 @@ public class AsyncServletTest
Assert.assertThat(response,Matchers.startsWith("HTTP/1.1 500 ")); Assert.assertThat(response,Matchers.startsWith("HTTP/1.1 500 "));
assertThat(__history,contains( assertThat(__history,contains(
"REQUEST /ctx/noasync/info", "REQUEST /ctx/noasync/info",
"initial" "initial",
"ERROR /ctx/error/custom",
"!initial"
)); ));
assertContains("HTTP ERROR: 500",response); assertContains("500",response);
assertContains("!asyncSupported",response); assertContains("!asyncSupported",response);
assertContains("AsyncServletTest$AsyncServlet",response); assertContains("AsyncServletTest$AsyncServlet",response);
} }
finally finally
{ {
((StdErrLog)getLogger(ServletHandler.class)).setHideStacks(false); ((StdErrLog)getLogger(HttpChannel.class)).setHideStacks(false);
} }
} }
@ -1003,6 +1007,8 @@ public class AsyncServletTest
else if(request.getDispatcherType()==DispatcherType.ERROR) else if(request.getDispatcherType()==DispatcherType.ERROR)
{ {
response.getOutputStream().println("ERROR DISPATCH: "+request.getContextPath()+request.getServletPath()+request.getPathInfo()); response.getOutputStream().println("ERROR DISPATCH: "+request.getContextPath()+request.getServletPath()+request.getPathInfo());
response.getOutputStream().println(""+request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE));
response.getOutputStream().println(""+request.getAttribute(RequestDispatcher.ERROR_MESSAGE));
} }
else else
{ {