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:
parent
1848e73ce6
commit
9e76b5319e
@ -499,7 +499,7 @@ public class DnsNameResolverTest {
|
|||||||
try {
|
try {
|
||||||
InetAddress address = resolver.resolve("10.0.0.1").syncUninterruptibly().getNow();
|
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 {
|
} finally {
|
||||||
resolver.close();
|
resolver.close();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user