use of io.vertx.core.dns.DnsClient in project vert.x by eclipse.
the class DNSTest method testResolveMX.
@Test
public void testResolveMX() throws Exception {
final String mxRecord = "mail.vertx.io";
final int prio = 10;
DnsClient dns = prepareDns(FakeDNSServer.testResolveMX(prio, mxRecord));
dns.resolveMX("vertx.io", ar -> {
List<MxRecord> result = ar.result();
assertNotNull(result);
assertFalse(result.isEmpty());
assertEquals(1, result.size());
MxRecord record = result.get(0);
assertEquals(prio, record.priority());
assertEquals(record.name(), mxRecord);
testComplete();
});
await();
dnsServer.stop();
}
use of io.vertx.core.dns.DnsClient in project vert.x by eclipse.
the class DNSTest method testResolveTXT.
@Test
public void testResolveTXT() throws Exception {
final String txt = "vertx is awesome";
DnsClient dns = prepareDns(FakeDNSServer.testResolveTXT(txt));
dns.resolveTXT("vertx.io", ar -> {
List<String> result = ar.result();
assertNotNull(result);
assertFalse(result.isEmpty());
assertEquals(1, result.size());
assertEquals(txt, result.get(0));
testComplete();
});
await();
dnsServer.stop();
}
use of io.vertx.core.dns.DnsClient in project vert.x by eclipse.
the class DNSTest method testResolveCNAME.
@Test
public void testResolveCNAME() throws Exception {
final String cname = "cname.vertx.io";
DnsClient dns = prepareDns(FakeDNSServer.testResolveCNAME(cname));
dns.resolveCNAME("vertx.io", ar -> {
List<String> result = ar.result();
assertNotNull(result);
assertFalse(result.isEmpty());
assertEquals(1, result.size());
String record = result.get(0);
assertFalse(record.isEmpty());
assertEquals(cname, record);
testComplete();
});
await();
dnsServer.stop();
}
use of io.vertx.core.dns.DnsClient in project vert.x by eclipse.
the class DNSTest method testResolvePTR.
@Test
public void testResolvePTR() throws Exception {
final String ptr = "ptr.vertx.io";
DnsClient dns = prepareDns(FakeDNSServer.testResolvePTR(ptr));
dns.resolvePTR("10.0.0.1.in-addr.arpa", 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 testResolveSRV.
@Test
public void testResolveSRV() throws Exception {
final int priority = 10;
final int weight = 1;
final int port = 80;
final String target = "vertx.io";
DnsClient dns = prepareDns(FakeDNSServer.testResolveSRV(priority, weight, port, target));
dns.resolveSRV("vertx.io", ar -> {
List<SrvRecord> result = ar.result();
assertNotNull(result);
assertFalse(result.isEmpty());
assertEquals(1, result.size());
SrvRecord record = result.get(0);
assertEquals(priority, record.priority());
assertEquals(weight, record.weight());
assertEquals(port, record.port());
assertEquals(target, record.target());
testComplete();
});
await();
dnsServer.stop();
}
Aggregations