@Test public void testAccepts() throws Exception { final DnsHostMatcher dnsHostMatcher = new DnsHostMatcher(); dnsHostMatcher.setHost("localhost"); assertMatch(dnsHostMatcher, true, new URI("http: assertMatch(dnsHostMatcher, true, new URI("http: assertMatch(dnsHostMatcher, true, new URI("http: assertMatch(dnsHostMatcher, true, new URI("http: assertMatch(dnsHostMatcher, true, new URI("http: assertMatch(dnsHostMatcher, true, new URI("https: assertMatch(dnsHostMatcher, false, new URI("https: HttpMethod.GET); assertMatch(dnsHostMatcher, false, new URI("https: assertTrue(dnsHostMatcher.matches(MatchInfo.fromAuthScope( new AuthScope(AuthScope.ANY_HOST, 80, AuthScope.ANY_REALM, "http")))); assertTrue(dnsHostMatcher.matches(MatchInfo.fromAuthScope( new AuthScope("localhost", AuthScope.ANY_PORT, AuthScope.ANY_REALM, "http")))); assertTrue(dnsHostMatcher.matches(MatchInfo.fromAuthScope( new AuthScope("127.0.0.1", 80, AuthScope.ANY_REALM, AuthScope.ANY_SCHEME)))); dnsHostMatcher.setPort(8080); assertMatch(dnsHostMatcher, true, new URI("http: assertMatch(dnsHostMatcher, true, new URI("http: assertMatch(dnsHostMatcher, false, new URI("http: assertMatch(dnsHostMatcher, false, new URI("http: assertMatch(dnsHostMatcher, false, new URI("https: assertMatch(dnsHostMatcher, false, new URI("https: HttpMethod.GET); dnsHostMatcher.setPort(-1); dnsHostMatcher.setPathRegex("^/print.*"); assertMatch(dnsHostMatcher, true, new URI("http: assertMatch(dnsHostMatcher, true, new URI("http: assertMatch(dnsHostMatcher, true, new URI("http: assertMatch(dnsHostMatcher, true, new URI("http: assertMatch(dnsHostMatcher, false, new URI("http: assertMatch(dnsHostMatcher, false, new URI("http: assertMatch(dnsHostMatcher, false, new URI("http: assertMatch(dnsHostMatcher, false, new URI("http: }
public final void setHost(final String host) throws UnknownHostException { this.host = host; final InetAddress[] inetAddresses = InetAddress.getAllByName(host); for (InetAddress address: inetAddresses) { final AddressHostMatcher matcher = new AddressHostMatcher(); matcher.setIp(address.getHostAddress()); this.matchersForHost.add(matcher); } }
DnsHostMatcher extends HostMatcher { public final void setHost(final String host) throws UnknownHostException { this.host = host; final InetAddress[] inetAddresses = InetAddress.getAllByName(host); for (InetAddress address: inetAddresses) { final AddressHostMatcher matcher = new AddressHostMatcher(); matcher.setIp(address.getHostAddress()); this.matchersForHost.add(matcher); } } }
DnsHostMatcher extends HostMatcher { public final void setHost(final String host) throws UnknownHostException { this.host = host; final InetAddress[] inetAddresses = InetAddress.getAllByName(host); for (InetAddress address: inetAddresses) { final AddressHostMatcher matcher = new AddressHostMatcher(); matcher.setIp(address.getHostAddress()); this.matchersForHost.add(matcher); } }  }
DnsHostMatcher extends HostMatcher { public final void setHost(final String host) throws UnknownHostException { this.host = host; final InetAddress[] inetAddresses = InetAddress.getAllByName(host); for (InetAddress address: inetAddresses) { final AddressHostMatcher matcher = new AddressHostMatcher(); matcher.setIp(address.getHostAddress()); this.matchersForHost.add(matcher); } }  @Override final Optional<Boolean> tryOverrideValidation(final MatchInfo matchInfo); @Override final void validate(final List<Throwable> validationErrors, final Configuration configuration); final void setHost(final String host); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); }
DnsHostMatcher extends HostMatcher { public final void setHost(final String host) throws UnknownHostException { this.host = host; final InetAddress[] inetAddresses = InetAddress.getAllByName(host); for (InetAddress address: inetAddresses) { final AddressHostMatcher matcher = new AddressHostMatcher(); matcher.setIp(address.getHostAddress()); this.matchersForHost.add(matcher); } }  @Override final Optional<Boolean> tryOverrideValidation(final MatchInfo matchInfo); @Override final void validate(final List<Throwable> validationErrors, final Configuration configuration); final void setHost(final String host); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }