From fb7e4aeb29acf0d37930803fb36bd7d2f3ed57e2 Mon Sep 17 00:00:00 2001 From: Athena Yao Date: Wed, 27 May 2009 02:59:20 +0000 Subject: [PATCH] [277798] fix build failure; this was modified in the wrong file git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@301 7e9141cc-0065-0410-87d8-b60c137991c4 --- .../eclipse/jetty/testing/ServletTester.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/test-jetty-servlet/src/main/java/org/eclipse/jetty/testing/ServletTester.java b/test-jetty-servlet/src/main/java/org/eclipse/jetty/testing/ServletTester.java index 93ddae4e9c2..57a68aa9fc7 100644 --- a/test-jetty-servlet/src/main/java/org/eclipse/jetty/testing/ServletTester.java +++ b/test-jetty-servlet/src/main/java/org/eclipse/jetty/testing/ServletTester.java @@ -13,6 +13,7 @@ package org.eclipse.jetty.testing; +import java.net.InetAddress; import java.util.Enumeration; import java.util.EventListener; @@ -183,6 +184,11 @@ public class ServletTester } /* ------------------------------------------------------------ */ + /** Create a SelectChannel connector. + * This methods adds a select channel connector to the server + * @return A URL to access the server via the connector. + * @throws Exception + */ public String createChannelConnector(boolean localhost) throws Exception { @@ -197,15 +203,16 @@ public class ServletTester else connector.open(); - return "http://127.0.0.1:"+connector.getLocalPort(); + return "http://"+(localhost?"127.0.0.1": + InetAddress.getLocalHost().getHostAddress() + )+":"+connector.getLocalPort(); } } - + /* ------------------------------------------------------------ */ - /** Create a Socket connector. - * This methods adds a socket connector to the server - * @param locahost if true, only listen on local host, else listen on all interfaces. - * @return A URL to access the server via the socket connector. + /** Create a local connector. + * This methods adds a local connector to the server + * @return The LocalConnector object * @throws Exception */ public LocalConnector createLocalConnector()