@Test public void testResolvePTR() throws Exception { final String ptr = "ptr.vertx.io"; dnsServer.testResolvePTR(ptr); DnsClient dns = prepareDns(); dns.resolvePTR("10.0.0.1.in-addr.arpa", onSuccess(result -> { assertEquals(ptr, result); testComplete(); })); await(); }
@Test public void testIllegalArguments() throws Exception { dnsServer.testResolveAAAA("::1"); DnsClient dns = prepareDns(); assertNullPointerException(() -> dns.lookup(null, ar -> {})); assertNullPointerException(() -> dns.lookup4(null, ar -> {})); assertNullPointerException(() -> dns.lookup6(null, ar -> {})); assertNullPointerException(() -> dns.resolveA(null, ar -> {})); assertNullPointerException(() -> dns.resolveAAAA(null, ar -> {})); assertNullPointerException(() -> dns.resolveCNAME(null, ar -> {})); assertNullPointerException(() -> dns.resolveMX(null, ar -> {})); assertNullPointerException(() -> dns.resolveTXT(null, ar -> {})); assertNullPointerException(() -> dns.resolvePTR(null, ar -> {})); assertNullPointerException(() -> dns.resolveNS(null, ar -> {})); assertNullPointerException(() -> dns.resolveSRV(null, ar -> {})); }
/** * Try to resolve the PTR record for the given name. * @param name the name to resolve the PTR for * @param handler the to notify with the . The handler will get notified with the resolved {@link java.lang.String} if a record was found. If none was found it will get notified with <code>null</code>. If an error accours it will get failed. * @return a reference to this, so the API can be used fluently. */ public io.vertx.rxjava.core.dns.DnsClient resolvePTR(String name, Handler<AsyncResult<String>> handler) { delegate.resolvePTR(name, handler); return this; }
/** * Try to resolve the PTR record for the given name. * @param name the name to resolve the PTR for * @param handler the to notify with the . The handler will get notified with the resolved {@link java.lang.String} if a record was found. If none was found it will get notified with <code>null</code>. If an error accours it will get failed. * @return a reference to this, so the API can be used fluently. */ public io.vertx.rxjava.core.dns.DnsClient resolvePTR(String name, Handler<AsyncResult<String>> handler) { delegate.resolvePTR(name, handler); return this; }
@Test public void testResolvePTR() throws Exception { final String ptr = "ptr.vertx.io"; dnsServer.testResolvePTR(ptr); DnsClient dns = prepareDns(); dns.resolvePTR("10.0.0.1.in-addr.arpa", onSuccess(result -> { assertEquals(ptr, result); testComplete(); })); await(); }
@Test public void testIllegalArguments() throws Exception { dnsServer.testResolveAAAA("::1"); DnsClient dns = prepareDns(); assertNullPointerException(() -> dns.lookup(null, ar -> {})); assertNullPointerException(() -> dns.lookup4(null, ar -> {})); assertNullPointerException(() -> dns.lookup6(null, ar -> {})); assertNullPointerException(() -> dns.resolveA(null, ar -> {})); assertNullPointerException(() -> dns.resolveAAAA(null, ar -> {})); assertNullPointerException(() -> dns.resolveCNAME(null, ar -> {})); assertNullPointerException(() -> dns.resolveMX(null, ar -> {})); assertNullPointerException(() -> dns.resolveTXT(null, ar -> {})); assertNullPointerException(() -> dns.resolvePTR(null, ar -> {})); assertNullPointerException(() -> dns.resolveNS(null, ar -> {})); assertNullPointerException(() -> dns.resolveSRV(null, ar -> {})); }