use host address instead of host name in tests to not do host lookup
This commit is contained in:
parent
ed473e272d
commit
a3c3d4073b
|
@ -18,13 +18,12 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.test.integration.rest.helper;
|
package org.elasticsearch.test.integration.rest.helper;
|
||||||
|
|
||||||
|
import com.google.common.base.Charsets;
|
||||||
import org.elasticsearch.ElasticSearchException;
|
import org.elasticsearch.ElasticSearchException;
|
||||||
import org.elasticsearch.common.io.Streams;
|
import org.elasticsearch.common.io.Streams;
|
||||||
import org.elasticsearch.common.transport.InetSocketTransportAddress;
|
import org.elasticsearch.common.transport.InetSocketTransportAddress;
|
||||||
import org.elasticsearch.common.transport.TransportAddress;
|
import org.elasticsearch.common.transport.TransportAddress;
|
||||||
|
|
||||||
import com.google.common.base.Charsets;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
@ -32,8 +31,8 @@ import java.net.HttpURLConnection;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public class HttpClient {
|
public class HttpClient {
|
||||||
|
|
||||||
|
@ -42,7 +41,7 @@ public class HttpClient {
|
||||||
public HttpClient(TransportAddress transportAddress) {
|
public HttpClient(TransportAddress transportAddress) {
|
||||||
InetSocketAddress address = ((InetSocketTransportAddress) transportAddress).address();
|
InetSocketAddress address = ((InetSocketTransportAddress) transportAddress).address();
|
||||||
try {
|
try {
|
||||||
baseUrl = new URL("http", address.getHostName(), address.getPort(), "/");
|
baseUrl = new URL("http", address.getAddress().getHostAddress(), address.getPort(), "/");
|
||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException e) {
|
||||||
throw new ElasticSearchException("", e);
|
throw new ElasticSearchException("", e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue