Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2010-05-17 16:02:09 -0400
committerGreg Wilkins2010-05-17 16:02:09 -0400
commitf5559e3f3a2090d15f81d3a566ff282514de0be9 (patch)
tree4dd38e0a01f2b6a7aa976c59b6767752680e0584
parenta4473b746b26bddfb07adbe7b3781e94b61bbf1d (diff)
downloadorg.eclipse.jetty.project-f5559e3f3a2090d15f81d3a566ff282514de0be9.tar.gz
org.eclipse.jetty.project-f5559e3f3a2090d15f81d3a566ff282514de0be9.tar.xz
org.eclipse.jetty.project-f5559e3f3a2090d15f81d3a566ff282514de0be9.zip
313196 randomly allocate ports for session test.
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@1815 7e9141cc-0065-0410-87d8-b60c137991c4
-rw-r--r--VERSION.txt3
-rw-r--r--tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractOrphanedSessionTest.java8
-rw-r--r--tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractTestServer.java5
3 files changed, 12 insertions, 4 deletions
diff --git a/VERSION.txt b/VERSION.txt
index a73608126a..d3a094cc55 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 e223bdaa81..db8918e687 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 8edde246bc..71f592ebc9 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)
{

Back to the top