Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestFixture.java')
-rw-r--r--jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestFixture.java17
1 files changed, 14 insertions, 3 deletions
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestFixture.java b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestFixture.java
index c06034279c..06def0cc90 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestFixture.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestFixture.java
@@ -37,6 +37,7 @@ import org.eclipse.jetty.server.handler.AbstractHandler;
import org.eclipse.jetty.server.handler.HandlerWrapper;
import org.eclipse.jetty.toolchain.test.PropertyFlag;
import org.eclipse.jetty.util.IO;
+import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.junit.After;
import org.junit.Before;
@@ -45,8 +46,10 @@ public class HttpServerTestFixture
protected static final long PAUSE=10L;
protected static final int LOOPS= PropertyFlag.isEnabled("test.stress")?250:50;
+ protected QueuedThreadPool _threadPool;
protected Server _server;
protected URI _serverURI;
+ protected HttpConfiguration _httpConfiguration;
protected ServerConnector _connector;
protected String _scheme="http";
@@ -62,15 +65,23 @@ public class HttpServerTestFixture
@Before
public void before()
{
- _server = new Server();
+ _threadPool = new QueuedThreadPool();
+ _server = new Server(_threadPool);
}
protected void startServer(ServerConnector connector) throws Exception
{
+ startServer(connector,new HandlerWrapper());
+ }
+
+ protected void startServer(ServerConnector connector, Handler handler) throws Exception
+ {
_connector = connector;
- _connector.getConnectionFactory(HttpConnectionFactory.class).getHttpConfiguration().setSendDateHeader(false);
+ _httpConfiguration=_connector.getConnectionFactory(HttpConnectionFactory.class).getHttpConfiguration();
+ _httpConfiguration.setBlockingTimeout(-1);
+ _httpConfiguration.setSendDateHeader(false);
_server.addConnector(_connector);
- _server.setHandler(new HandlerWrapper());
+ _server.setHandler(handler);
_server.start();
_serverURI = _server.getURI();
}

Back to the top