Get more tests passing with Jetty9

This commit is contained in:
Daniel Kulp 2015-01-15 12:16:17 -05:00
parent f4eade2bb3
commit 3ec36818eb
2 changed files with 7 additions and 9 deletions

View File

@ -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);

View File

@ -81,7 +81,7 @@
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-websocket</artifactId>
<version>${jetty-version}</version>
<version>${jetty8-version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>