From df9de50f96b7c21270ef2e173a89ca29abdea087 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 17 Mar 2016 10:33:58 +1100 Subject: [PATCH] Issue #434 RequestTest stack traces Added reset to ShutdownMonitor --- .../java/org/eclipse/jetty/server/ShutdownMonitor.java | 5 +++++ .../java/org/eclipse/jetty/server/ShutdownMonitorTest.java | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ShutdownMonitor.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ShutdownMonitor.java index f6f3f1c526b..9e418932111 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ShutdownMonitor.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ShutdownMonitor.java @@ -64,6 +64,11 @@ public class ShutdownMonitor return Holder.instance; } + protected static void reset() + { + Holder.instance = new ShutdownMonitor(); + } + public static void register(LifeCycle... lifeCycles) { getInstance().addLifeCycles(lifeCycles); diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ShutdownMonitorTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ShutdownMonitorTest.java index a56639929e8..f0e4e7f1f67 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ShutdownMonitorTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ShutdownMonitorTest.java @@ -26,6 +26,7 @@ import java.net.InetAddress; import java.net.Socket; import org.eclipse.jetty.util.thread.ShutdownThread; +import org.junit.AfterClass; import org.junit.Test; import static org.junit.Assert.assertEquals; @@ -33,6 +34,12 @@ import static org.junit.Assert.assertTrue; public class ShutdownMonitorTest { + @AfterClass + public static void afterClass() + { + ShutdownMonitor.reset(); + } + @Test public void testShutdownMonitor() throws Exception {