From df0f645aa474141432b3ebdd736fd1cc34dd70a1 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 12 Jan 2017 11:29:56 +1100 Subject: [PATCH] fix #1248 --- .../org/eclipse/jetty/http2/client/StreamResetTest.java | 7 +++++-- .../main/java/org/eclipse/jetty/server/HttpChannel.java | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/StreamResetTest.java b/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/StreamResetTest.java index deab7f4bb69..4c0b174e8b9 100644 --- a/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/StreamResetTest.java +++ b/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/StreamResetTest.java @@ -51,11 +51,12 @@ import org.eclipse.jetty.http2.api.server.ServerSessionListener; import org.eclipse.jetty.http2.frames.DataFrame; import org.eclipse.jetty.http2.frames.HeadersFrame; import org.eclipse.jetty.http2.frames.ResetFrame; +import org.eclipse.jetty.server.HttpChannel; import org.eclipse.jetty.server.HttpOutput; -import org.eclipse.jetty.servlet.ServletHandler; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.FutureCallback; import org.eclipse.jetty.util.FuturePromise; +import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.StacklessLogging; import org.hamcrest.Matchers; import org.junit.Assert; @@ -409,7 +410,7 @@ public class StreamResetTest extends AbstractTest @Test public void testServerExceptionConsumesQueuedData() throws Exception { - try (StacklessLogging suppressor = new StacklessLogging(ServletHandler.class)) + try (StacklessLogging suppressor = new StacklessLogging(HttpChannel.class)) { start(new HttpServlet() { @@ -430,6 +431,8 @@ public class StreamResetTest extends AbstractTest }); Session client = newClient(new Session.Listener.Adapter()); + + Log.getLogger(HttpChannel.class).info("Expecting java.lang.IllegalStateException: explictly_thrown_by_test"); MetaData.Request request = newRequest("GET", new HttpFields()); HeadersFrame frame = new HeadersFrame(request, null, false); FuturePromise promise = new FuturePromise<>(); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java index f0e6ade514e..0250200e895 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java @@ -18,6 +18,9 @@ package org.eclipse.jetty.server; +import static javax.servlet.RequestDispatcher.ERROR_EXCEPTION; +import static javax.servlet.RequestDispatcher.ERROR_STATUS_CODE; + import java.io.IOException; import java.net.InetSocketAddress; import java.nio.ByteBuffer; @@ -51,9 +54,6 @@ import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Scheduler; -import static javax.servlet.RequestDispatcher.ERROR_EXCEPTION; -import static javax.servlet.RequestDispatcher.ERROR_STATUS_CODE; - /** * HttpChannel represents a single endpoint for HTTP semantic processing.