aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.junit.http/src
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit.junit.http/src')
-rw-r--r--org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java
index ce04bdf2c6..c36c297623 100644
--- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java
+++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java
@@ -104,6 +104,15 @@ public class AppServer {
private final TestRequestLog log;
public AppServer() {
+ this(0);
+ }
+
+ /**
+ * @param port
+ * the http port number
+ * @since 4.2
+ */
+ public AppServer(int port) {
server = new Server();
HttpConfiguration http_config = new HttpConfiguration();
@@ -113,7 +122,7 @@ public class AppServer {
connector = new ServerConnector(server,
new HttpConnectionFactory(http_config));
- connector.setPort(0);
+ connector.setPort(port);
try {
final InetAddress me = InetAddress.getByName("localhost");
connector.setHost(me.getHostAddress());