summaryrefslogtreecommitdiff
path: root/core/src/test/java/org/elasticsearch/common
diff options
context:
space:
mode:
authorSimon Willnauer <simonw@apache.org>2017-07-02 10:16:50 +0200
committerGitHub <noreply@github.com>2017-07-02 10:16:50 +0200
commit5a7c8bb04ed135be1823a4db6b08f7481d7d22c0 (patch)
treeefbc4ac1d1f0bf0f09c4587d74de16d3d5096a84 /core/src/test/java/org/elasticsearch/common
parent2975e7f511d784b1a1d6dfea95d3e75ab241dfdb (diff)
Cleanup network / transport related settings (#25489)
This commit makes the use of the global network settings explicit instead of implicit within NetworkService. It cleans up several places where we fall back to the global settings while we should have used tcp or http ones. In addition this change also removes unnecessary settings classes
Diffstat (limited to 'core/src/test/java/org/elasticsearch/common')
-rw-r--r--core/src/test/java/org/elasticsearch/common/network/NetworkServiceTests.java24
1 files changed, 12 insertions, 12 deletions
diff --git a/core/src/test/java/org/elasticsearch/common/network/NetworkServiceTests.java b/core/src/test/java/org/elasticsearch/common/network/NetworkServiceTests.java
index 096d3b0a9a..d446c6682b 100644
--- a/core/src/test/java/org/elasticsearch/common/network/NetworkServiceTests.java
+++ b/core/src/test/java/org/elasticsearch/common/network/NetworkServiceTests.java
@@ -19,7 +19,6 @@
package org.elasticsearch.common.network;
-import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.test.ESTestCase;
import java.net.InetAddress;
@@ -37,7 +36,7 @@ public class NetworkServiceTests extends ESTestCase {
* ensure exception if we bind to multicast ipv4 address
*/
public void testBindMulticastV4() throws Exception {
- NetworkService service = new NetworkService(Settings.EMPTY, Collections.emptyList());
+ NetworkService service = new NetworkService(Collections.emptyList());
try {
service.resolveBindHostAddresses(new String[] { "239.1.1.1" });
fail("should have hit exception");
@@ -49,7 +48,7 @@ public class NetworkServiceTests extends ESTestCase {
* ensure exception if we bind to multicast ipv6 address
*/
public void testBindMulticastV6() throws Exception {
- NetworkService service = new NetworkService(Settings.EMPTY, Collections.emptyList());
+ NetworkService service = new NetworkService(Collections.emptyList());
try {
service.resolveBindHostAddresses(new String[] { "FF08::108" });
fail("should have hit exception");
@@ -62,7 +61,7 @@ public class NetworkServiceTests extends ESTestCase {
* ensure exception if we publish to multicast ipv4 address
*/
public void testPublishMulticastV4() throws Exception {
- NetworkService service = new NetworkService(Settings.EMPTY, Collections.emptyList());
+ NetworkService service = new NetworkService(Collections.emptyList());
try {
service.resolvePublishHostAddresses(new String[] { "239.1.1.1" });
fail("should have hit exception");
@@ -75,7 +74,7 @@ public class NetworkServiceTests extends ESTestCase {
* ensure exception if we publish to multicast ipv6 address
*/
public void testPublishMulticastV6() throws Exception {
- NetworkService service = new NetworkService(Settings.EMPTY, Collections.emptyList());
+ NetworkService service = new NetworkService(Collections.emptyList());
try {
service.resolvePublishHostAddresses(new String[] { "FF08::108" });
fail("should have hit exception");
@@ -88,15 +87,16 @@ public class NetworkServiceTests extends ESTestCase {
* ensure specifying wildcard ipv4 address will bind to all interfaces
*/
public void testBindAnyLocalV4() throws Exception {
- NetworkService service = new NetworkService(Settings.EMPTY, Collections.emptyList());
- assertEquals(InetAddress.getByName("0.0.0.0"), service.resolveBindHostAddresses(new String[] { "0.0.0.0" })[0]);
+ NetworkService service = new NetworkService(Collections.emptyList());
+ assertEquals(InetAddress.getByName("0.0.0.0"), service.resolveBindHostAddresses(new String[] { "0.0.0.0" }
+ )[0]);
}
/**
* ensure specifying wildcard ipv6 address will bind to all interfaces
*/
public void testBindAnyLocalV6() throws Exception {
- NetworkService service = new NetworkService(Settings.EMPTY, Collections.emptyList());
+ NetworkService service = new NetworkService(Collections.emptyList());
assertEquals(InetAddress.getByName("::"), service.resolveBindHostAddresses(new String[] { "::" })[0]);
}
@@ -104,7 +104,7 @@ public class NetworkServiceTests extends ESTestCase {
* ensure specifying wildcard ipv4 address selects reasonable publish address
*/
public void testPublishAnyLocalV4() throws Exception {
- NetworkService service = new NetworkService(Settings.EMPTY, Collections.emptyList());
+ NetworkService service = new NetworkService(Collections.emptyList());
InetAddress address = service.resolvePublishHostAddresses(new String[] { "0.0.0.0" });
assertFalse(address.isAnyLocalAddress());
}
@@ -113,7 +113,7 @@ public class NetworkServiceTests extends ESTestCase {
* ensure specifying wildcard ipv6 address selects reasonable publish address
*/
public void testPublishAnyLocalV6() throws Exception {
- NetworkService service = new NetworkService(Settings.EMPTY, Collections.emptyList());
+ NetworkService service = new NetworkService(Collections.emptyList());
InetAddress address = service.resolvePublishHostAddresses(new String[] { "::" });
assertFalse(address.isAnyLocalAddress());
}
@@ -122,7 +122,7 @@ public class NetworkServiceTests extends ESTestCase {
* ensure we can bind to multiple addresses
*/
public void testBindMultipleAddresses() throws Exception {
- NetworkService service = new NetworkService(Settings.EMPTY, Collections.emptyList());
+ NetworkService service = new NetworkService(Collections.emptyList());
InetAddress[] addresses = service.resolveBindHostAddresses(new String[]{"127.0.0.1", "127.0.0.2"});
assertThat(addresses.length, is(2));
}
@@ -131,7 +131,7 @@ public class NetworkServiceTests extends ESTestCase {
* ensure we can't bind to multiple addresses when using wildcard
*/
public void testBindMultipleAddressesWithWildcard() throws Exception {
- NetworkService service = new NetworkService(Settings.EMPTY, Collections.emptyList());
+ NetworkService service = new NetworkService(Collections.emptyList());
try {
service.resolveBindHostAddresses(new String[]{"0.0.0.0", "127.0.0.1"});
fail("should have hit exception");