diff options
author | Harald Musum <musum@verizonmedia.com> | 2019-09-23 16:12:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-23 16:12:12 +0200 |
commit | 5d9cf7eab1eac805b933d07321d95524a8cb2164 (patch) | |
tree | 2980ee536afafa6126e1b783554d4e7f9e0a9cd2 /container-search/src/test/java/com/yahoo/prelude/cluster/ClusterSearcherTestCase.java | |
parent | 8affeae3e0659a7254aea22582919b85a412a8fe (diff) |
Revert "Balder/remove tld from config model rebased"
Diffstat (limited to 'container-search/src/test/java/com/yahoo/prelude/cluster/ClusterSearcherTestCase.java')
-rw-r--r-- | container-search/src/test/java/com/yahoo/prelude/cluster/ClusterSearcherTestCase.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/container-search/src/test/java/com/yahoo/prelude/cluster/ClusterSearcherTestCase.java b/container-search/src/test/java/com/yahoo/prelude/cluster/ClusterSearcherTestCase.java index f35d77de01a..c772300876b 100644 --- a/container-search/src/test/java/com/yahoo/prelude/cluster/ClusterSearcherTestCase.java +++ b/container-search/src/test/java/com/yahoo/prelude/cluster/ClusterSearcherTestCase.java @@ -21,9 +21,12 @@ import com.yahoo.search.Result; import com.yahoo.search.config.ClusterConfig; import com.yahoo.search.result.Hit; import com.yahoo.search.searchchain.Execution; +import com.yahoo.statistics.Statistics; import com.yahoo.vespa.config.search.DispatchConfig; import org.junit.Test; +import java.net.InetAddress; +import java.net.UnknownHostException; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; @@ -417,6 +420,26 @@ public class ClusterSearcherTestCase { } @Test + public void testLocalConnect() throws UnknownHostException { + ClusterSearcher cluster = new ClusterSearcher(new LinkedHashSet<>(Arrays.asList("dummy"))); + boolean canFindYahoo; + final String yahoo = "www.yahoo.com"; + + try { + canFindYahoo = (null != InetAddress.getByName(yahoo)); + } catch (Exception e) { + canFindYahoo = false; + } + + assertFalse(cluster.isRemote("127.0.0.1")); + assertFalse(cluster.isRemote("localhost")); + + if (canFindYahoo) { + assertTrue(cluster.isRemote(yahoo)); + } + } + + @Test public void testRequireThatSearchFailsForUndefinedRankProfileWithOneDocType() { Execution execution = createExecution(Arrays.asList("type1"), false); @@ -502,6 +525,10 @@ public class ClusterSearcherTestCase { searchClusterConfig.searchdef("streaming_sd"); } qrSearchersConfig.searchcluster(searchClusterConfig); + QrSearchersConfig.Searchcluster.Dispatcher.Builder dispatcherConfig = new QrSearchersConfig.Searchcluster.Dispatcher.Builder(); + dispatcherConfig.host("localhost"); + dispatcherConfig.port(0); + searchClusterConfig.dispatcher(dispatcherConfig); ClusterConfig.Builder clusterConfig = new ClusterConfig.Builder().clusterName(clusterName); if (maxQueryTimeout != null) |