Fix testResolveIp to make it work in some special environment

Motivation:

As "getHostName" may do a reverse name lookup and return a host name based on the system configured name lookup service, testResolveIp may fail in some special environment. See #4720

Modifications:

Use getHostAddress instead of getHostName

Result:

testResolveIp works in all environments
This commit is contained in:
Xiaoyan Lin 2016-01-17 23:07:02 -08:00 committed by Norman Maurer
parent 1848e73ce6
commit 9e76b5319e

View File

@ -499,7 +499,7 @@ public class DnsNameResolverTest {
try {
InetAddress address = resolver.resolve("10.0.0.1").syncUninterruptibly().getNow();
assertEquals("10.0.0.1", address.getHostName());
assertEquals("10.0.0.1", address.getHostAddress());
} finally {
resolver.close();
}