summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--jdisc_http_service/src/main/java/com/yahoo/jdisc/http/server/jetty/JettyHttpServer.java2
-rw-r--r--vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/DocumentApiApplicationTest.java15
2 files changed, 3 insertions, 14 deletions
diff --git a/jdisc_http_service/src/main/java/com/yahoo/jdisc/http/server/jetty/JettyHttpServer.java b/jdisc_http_service/src/main/java/com/yahoo/jdisc/http/server/jetty/JettyHttpServer.java
index e72f8bceb1f..2f96cb76ae0 100644
--- a/jdisc_http_service/src/main/java/com/yahoo/jdisc/http/server/jetty/JettyHttpServer.java
+++ b/jdisc_http_service/src/main/java/com/yahoo/jdisc/http/server/jetty/JettyHttpServer.java
@@ -223,7 +223,7 @@ public class JettyHttpServer extends AbstractServerProvider {
logEffectiveSslConfiguration();
} catch (final Exception e) {
if (e instanceof IOException && e.getCause() instanceof BindException) {
- throw new RuntimeException("Failed to start server due to BindExecption. ListenPorts = " + listenedPorts.toString(), e.getCause());
+ throw new RuntimeException("Failed to start server due to BindException. ListenPorts = " + listenedPorts.toString(), e.getCause());
}
throw new RuntimeException("Failed to start server.", e);
}
diff --git a/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/DocumentApiApplicationTest.java b/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/DocumentApiApplicationTest.java
index b303e663f32..fd45a0d5dd7 100644
--- a/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/DocumentApiApplicationTest.java
+++ b/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/DocumentApiApplicationTest.java
@@ -5,9 +5,6 @@ import com.yahoo.application.Application;
import com.yahoo.application.Networking;
import org.junit.Test;
-import java.io.IOException;
-import java.net.ServerSocket;
-
/**
* @author bratseth
*/
@@ -15,22 +12,14 @@ public class DocumentApiApplicationTest {
/** Test that it is possible to instantiate an Application with a document-api */
@Test
- public void application_with_document_api() throws IOException {
+ public void application_with_document_api() {
String services =
"<container version='1.0'>" +
- " <http><server port=\"" + findRandomOpenPortOnAllLocalInterfaces() + "\" id=\"foobar\"/></http>" +
+ " <http><server port=\"0\" id=\"foobar\"/></http>" +
" <document-api/>" +
"</container>";
try (Application application = Application.fromServicesXml(services, Networking.enable)) {
}
}
- private int findRandomOpenPortOnAllLocalInterfaces() throws IOException {
- ServerSocket socket = new ServerSocket(0);
- socket.setReuseAddress(true);
- int port = socket.getLocalPort();
- socket.close();
- return port;
- }
-
}