@Test public void testResolveSRV() throws Exception { final int priority = 10; final int weight = 1; final int port = 80; final String target = "vertx.io"; dnsServer.testResolveSRV(priority, weight, port, target); DnsClient dns = prepareDns(); 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(); }
/** * Convert a single srvRecord into an EndpointDefinition. * * @param srvRecord srvRecord * @return EndpointDefinition from srvRecord */ private EndpointDefinition convertSrvRecordToEndpointDefinition(final SrvRecord srvRecord) { return new EndpointDefinition(findServiceName(srvRecord.service()), srvRecord.target(), srvRecord.port()); }
@Override public int compareTo(SrvRecord o) { return Integer.valueOf(priority()).compareTo(o.priority()); } }
/** * Returns the name of the host for the service. * @return */ public String target() { String ret = delegate.target(); return ret; }
/** * Returns the port the service is running on. * @return */ public int port() { int ret = delegate.port(); return ret; }
/** * Returns the service's name (i.e. "_http"). * @return */ public String service() { String ret = delegate.service(); return ret; }
/** * Returns the weight of this service record. * @return */ public int weight() { int ret = delegate.weight(); return ret; }
/** * Returns the protocol for the service being queried (i.e. "_tcp"). * @return */ public String protocol() { String ret = delegate.protocol(); return ret; }
/** * Returns the name for the server being queried. * @return */ public String name() { String ret = delegate.name(); return ret; }
@Override public int compareTo(SrvRecord o) { return Integer.valueOf(priority()).compareTo(o.priority()); } }
/** * Returns the name of the host for the service. * @return */ public String target() { String ret = delegate.target(); return ret; }
/** * Returns the port the service is running on. * @return */ public int port() { int ret = delegate.port(); return ret; }
/** * Returns the service's name (i.e. "_http"). * @return */ public String service() { String ret = delegate.service(); return ret; }
/** * Returns the weight of this service record. * @return */ public int weight() { int ret = delegate.weight(); return ret; }
/** * Returns the protocol for the service being queried (i.e. "_tcp"). * @return */ public String protocol() { String ret = delegate.protocol(); return ret; }
/** * Returns the name for the server being queried. * @return */ public String name() { String ret = delegate.name(); return ret; }
@Test public void testResolveSRV() throws Exception { final int priority = 10; final int weight = 1; final int port = 80; final String target = "vertx.io"; dnsServer.testResolveSRV(priority, weight, port, target); DnsClient dns = prepareDns(); 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(); }
/** * Convert a single srvRecord into an EndpointDefinition. * @param srvRecord srvRecord * @return EndpointDefinition from srvRecord */ private EndpointDefinition convertSrvRecordToEndpointDefinition(final SrvRecord srvRecord) { return new EndpointDefinition(findServiceName(srvRecord.service()), srvRecord.target(), srvRecord.port()); }
/** * Returns the priority for this service record. * @return */ public int priority() { int ret = delegate.priority(); return ret; }
/** * Returns the priority for this service record. * @return */ public int priority() { int ret = delegate.priority(); return ret; }