Package io.vertx.core.dns

Examples of io.vertx.core.dns.DnsClient


    await();
  }

  @Test
  public void testLookup6() throws Exception {
    DnsClient dns = prepareDns(FakeDNSServer.testLookup6());

    dns.lookup6("vertx.io", ar -> {
      String result = ar.result();
      assertNotNull(result);
      assertEquals("0:0:0:0:0:0:0:1", result);
      testComplete();
    });
View Full Code Here


  }

  @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();
    });
View Full Code Here

    await();
  }

  @Test
  public void testLookupNonExisting() throws Exception {
    DnsClient dns = prepareDns(FakeDNSServer.testLookupNonExisting());
    dns.lookup("gfegjegjf.sg1", ar -> {
      DnsException cause = (DnsException)ar.cause();
      assertEquals(DnsResponseCode.NXDOMAIN, cause.code());
      testComplete();
    });
    await();
View Full Code Here

  @Test
  public void testReverseLookupIpv4() throws Exception {
    String address = "10.0.0.1";
    final String ptr = "ptr.vertx.io";
    DnsClient dns = prepareDns(FakeDNSServer.testReverseLookup(ptr));

    dns.reverseLookup(address, ar -> {
      String result = ar.result();
      assertNotNull(result);
      assertEquals(ptr, result);
      testComplete();
    });
View Full Code Here

  @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();
    });
View Full Code Here

TOP

Related Classes of io.vertx.core.dns.DnsClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.