From 7390707e07c8713c39d2cfb6c98e79841b033670 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Thu, 17 Aug 2017 16:37:13 +0200 Subject: [PATCH] Fixes #1750 - PoolingHttpDestination creates ConnectionPool twice. Now destinations needs to be started in tests. --- .../jetty/client/http/HttpDestinationOverHTTPTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpDestinationOverHTTPTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpDestinationOverHTTPTest.java index 9f1cd0d9b2c..791d56d23bb 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpDestinationOverHTTPTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/http/HttpDestinationOverHTTPTest.java @@ -59,6 +59,7 @@ public class HttpDestinationOverHTTPTest extends AbstractHttpClientServerTest public void test_FirstAcquire_WithEmptyQueue() throws Exception { HttpDestinationOverHTTP destination = new HttpDestinationOverHTTP(client, new Origin("http", "localhost", connector.getLocalPort())); + destination.start(); Connection connection = destination.acquire(); if (connection == null) { @@ -72,6 +73,7 @@ public class HttpDestinationOverHTTPTest extends AbstractHttpClientServerTest public void test_SecondAcquire_AfterFirstAcquire_WithEmptyQueue_ReturnsSameConnection() throws Exception { HttpDestinationOverHTTP destination = new HttpDestinationOverHTTP(client, new Origin("http", "localhost", connector.getLocalPort())); + destination.start(); Connection connection1 = destination.acquire(); if (connection1 == null) { @@ -118,6 +120,7 @@ public class HttpDestinationOverHTTPTest extends AbstractHttpClientServerTest }; } }; + destination.start(); Connection connection1 = destination.acquire(); // Make sure we entered idleCreated(). @@ -145,6 +148,7 @@ public class HttpDestinationOverHTTPTest extends AbstractHttpClientServerTest public void test_Acquire_Process_Release_Acquire_ReturnsSameConnection() throws Exception { HttpDestinationOverHTTP destination = new HttpDestinationOverHTTP(client, new Origin("http", "localhost", connector.getLocalPort())); + destination.start(); HttpConnectionOverHTTP connection1 = destination.acquire(); long start = System.nanoTime(); @@ -172,6 +176,7 @@ public class HttpDestinationOverHTTPTest extends AbstractHttpClientServerTest client.setIdleTimeout(idleTimeout); HttpDestinationOverHTTP destination = new HttpDestinationOverHTTP(client, new Origin("http", "localhost", connector.getLocalPort())); + destination.start(); Connection connection1 = destination.acquire(); if (connection1 == null) {