use of io.vertx.core.dns.DnsClient in project vert.x by eclipse.
the class DNSTest method testResolveA.
@Test
public void testResolveA() throws Exception {
final String ip = "10.0.0.1";
DnsClient dns = prepareDns(FakeDNSServer.testResolveA(ip));
dns.resolveA("vertx.io", ar -> {
List<String> result = ar.result();
assertNotNull(result);
assertFalse(result.isEmpty());
assertEquals(1, result.size());
assertEquals(ip, result.get(0));
testComplete();
});
await();
dnsServer.stop();
}
use of io.vertx.core.dns.DnsClient in project vert.x by eclipse.
the class DNSTest method testReverseLookupIpv6.
@Test
public void testReverseLookupIpv6() throws Exception {
final String ptr = "ptr.vertx.io";
DnsClient dns = prepareDns(FakeDNSServer.testReverseLookup(ptr));
dns.reverseLookup("::1", ar -> {
String result = ar.result();
assertNotNull(result);
assertEquals(ptr, result);
testComplete();
});
await();
dnsServer.stop();
}
use of io.vertx.core.dns.DnsClient in project vert.x by eclipse.
the class DNSTest method testLookup4CNAME.
@Test
public void testLookup4CNAME() throws Exception {
final String cname = "cname.vertx.io";
final String ip = "10.0.0.1";
DnsClient dns = prepareDns(FakeDNSServer.testLookup4CNAME(cname, ip));
dns.lookup4("vertx.io", ar -> {
String result = ar.result();
assertEquals(ip, result);
testComplete();
});
await();
dnsServer.stop();
}
use of io.vertx.core.dns.DnsClient in project vert.x by eclipse.
the class DNSTest method testLookup4.
@Test
public void testLookup4() throws Exception {
final String ip = "10.0.0.1";
DnsClient dns = prepareDns(FakeDNSServer.testLookup4(ip));
dns.lookup4("vertx.io", ar -> {
String result = ar.result();
assertNotNull(result);
assertEquals(ip, result);
testComplete();
});
await();
dnsServer.stop();
}
use of io.vertx.core.dns.DnsClient in project vert.x by eclipse.
the class DNSTest method testLookup.
@Test
public void testLookup() throws Exception {
final String ip = "10.0.0.1";
DnsClient dns = prepareDns(FakeDNSServer.testLookup(ip));
dns.lookup("vertx.io", ar -> {
String result = ar.result();
assertNotNull(result);
assertEquals(ip, result);
testComplete();
});
await();
dnsServer.stop();
}
Aggregations