diff --git a/VERSION.txt b/VERSION.txt index a73608126aa..d3a094cc553 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1,3 +1,6 @@ +jetty-SNAPSHOT + + 313196 randomly allocate ports for session test. + jetty-7.1.1.v20100517 + 302344 Make the list of available contexts if root context is not configured optional + 304803 Remove TypeUtil Integer and Long caches diff --git a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractOrphanedSessionTest.java b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractOrphanedSessionTest.java index e223bdaa81d..db8918e6877 100644 --- a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractOrphanedSessionTest.java +++ b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractOrphanedSessionTest.java @@ -51,18 +51,18 @@ public abstract class AbstractOrphanedSessionTest // Disable scavenging for the first server, so that we simulate its "crash". String contextPath = ""; String servletMapping = "/server"; - int port1 = random.nextInt(50000) + 10000; int inactivePeriod = 5; - AbstractTestServer server1 = createServer(port1, inactivePeriod, -1); + AbstractTestServer server1 = createServer(0, inactivePeriod, -1); server1.addContext(contextPath).addServlet(TestServlet.class, servletMapping); server1.start(); + int port1 = server1.getPort(); try { - int port2 = random.nextInt(50000) + 10000; int scavengePeriod = 2; - AbstractTestServer server2 = createServer(port2, inactivePeriod, scavengePeriod); + AbstractTestServer server2 = createServer(0, inactivePeriod, scavengePeriod); server2.addContext(contextPath).addServlet(TestServlet.class, servletMapping); server2.start(); + int port2 = server2.getPort(); try { HttpClient client = new HttpClient(); diff --git a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractTestServer.java b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractTestServer.java index 8edde246bca..71f592ebc9d 100644 --- a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractTestServer.java +++ b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractTestServer.java @@ -60,6 +60,11 @@ public abstract class AbstractTestServer _server.setHandler(_contexts); _server.start(); } + + public int getPort() + { + return _server.getConnectors()[0].getLocalPort(); + } public ServletContextHandler addContext(String contextPath) {