From 3ec36818eb440037ec0e351c656e7f1168bc44a6 Mon Sep 17 00:00:00 2001 From: Daniel Kulp Date: Thu, 15 Jan 2015 12:16:17 -0500 Subject: [PATCH] Get more tests passing with Jetty9 --- .../org/apache/activemq/util/HttpTestSupport.java | 14 ++++++-------- activemq-web/pom.xml | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/activemq-fileserver/src/test/java/org/apache/activemq/util/HttpTestSupport.java b/activemq-fileserver/src/test/java/org/apache/activemq/util/HttpTestSupport.java index 4f48843e0b..6ea0a25660 100644 --- a/activemq-fileserver/src/test/java/org/apache/activemq/util/HttpTestSupport.java +++ b/activemq-fileserver/src/test/java/org/apache/activemq/util/HttpTestSupport.java @@ -52,25 +52,23 @@ public abstract class HttpTestSupport extends TestCase { final File homeDir = new File("src/main/webapp/uploads/"); + + private int getPort(Object o) throws Exception { + return (Integer)o.getClass().getMethod("getLocalPort").invoke(o); + } @Override protected void setUp() throws Exception { - server = new Server(); - SelectChannelConnector connector = new SelectChannelConnector(); - connector.setPort(0); - connector.setServer(server); + server = new Server(0); WebAppContext context = new WebAppContext(); context.setResourceBase("src/main/webapp"); context.setContextPath("/"); context.setServer(server); server.setHandler(context); - server.setConnectors(new Connector[] { - connector - }); server.start(); - int port = connector.getLocalPort(); + int port = getPort(server.getConnectors()[0]); waitForJettySocketToAccept("http://localhost:" + port); diff --git a/activemq-web/pom.xml b/activemq-web/pom.xml index 4b38f78110..8417b58210 100755 --- a/activemq-web/pom.xml +++ b/activemq-web/pom.xml @@ -81,7 +81,7 @@ org.eclipse.jetty jetty-websocket - ${jetty-version} + ${jetty8-version} org.eclipse.jetty