@Test public void testNoSubdomain() throws Exception { HostnameMatcher hostnameHostMatcher = new HostnameMatcher(); hostnameHostMatcher.setHost("localhost"); assertMatch(hostnameHostMatcher, false, new URI("http: HttpMethod.GET); assertMatch(hostnameHostMatcher, true, new URI("http: HttpMethod.GET); assertMatch(hostnameHostMatcher, true, new URI("http: HttpMethod.POST); assertMatch(hostnameHostMatcher, true, new URI("http: assertMatch(hostnameHostMatcher, true, new URI("http: assertMatch(hostnameHostMatcher, true, new URI("https: assertMatch(hostnameHostMatcher, false, new URI("https: HttpMethod.GET); assertMatch(hostnameHostMatcher, false, new URI("https: assertTrue(hostnameHostMatcher.matches(MatchInfo.fromAuthScope( new AuthScope(AuthScope.ANY_HOST, 80, AuthScope.ANY_REALM, "http")))); assertTrue(hostnameHostMatcher.matches(MatchInfo.fromAuthScope( new AuthScope("localhost", AuthScope.ANY_PORT, AuthScope.ANY_REALM, "http")))); assertFalse(hostnameHostMatcher.matches(MatchInfo.fromAuthScope( new AuthScope("127.0.0.1", 80, AuthScope.ANY_REALM, AuthScope.ANY_SCHEME)))); hostnameHostMatcher.setPort(8080); assertMatch(hostnameHostMatcher, true, new URI("http: HttpMethod.GET); assertMatch(hostnameHostMatcher, true, new URI("http: HttpMethod.POST); assertMatch(hostnameHostMatcher, false, new URI("http: assertMatch(hostnameHostMatcher, false, new URI("http: assertMatch(hostnameHostMatcher, false, new URI("https: assertMatch(hostnameHostMatcher, false, new URI("https: HttpMethod.GET); hostnameHostMatcher.setPort(-1); hostnameHostMatcher.setPathRegex("^/print.*"); assertMatch(hostnameHostMatcher, true, new URI("http: HttpMethod.GET); assertMatch(hostnameHostMatcher, true, new URI("http: assertMatch(hostnameHostMatcher, true, new URI("http: assertMatch(hostnameHostMatcher, true, new URI("http: HttpMethod.GET); assertMatch(hostnameHostMatcher, false, new URI("http: assertMatch(hostnameHostMatcher, false, new URI("http: assertMatch(hostnameHostMatcher, false, new URI("http: HttpMethod.GET); assertMatch(hostnameHostMatcher, false, new URI("http: hostnameHostMatcher = new HostnameMatcher(); hostnameHostMatcher.setHost("www.camptocamp.com"); assertMatch(hostnameHostMatcher, true, new URI("http: assertMatch(hostnameHostMatcher, true, new URI("http: assertMatch(hostnameHostMatcher, false, new URI("http: assertMatch(hostnameHostMatcher, false, new URI("http: }
public void setHost(final String host) { this.host = host != null ? host.toLowerCase() : null; }
HostnameMatcher extends HostMatcher { public void setHost(final String host) { this.host = host != null ? host.toLowerCase() : null; } }
HostnameMatcher extends HostMatcher { public void setHost(final String host) { this.host = host != null ? host.toLowerCase() : null; }  }
HostnameMatcher extends HostMatcher { public void setHost(final String host) { this.host = host != null ? host.toLowerCase() : null; }  @Override void validate(final List<Throwable> validationErrors, final Configuration configuration); @Override String toString(); void setHost(final String host); void setAllowSubDomains(final boolean allowSubDomains); @Override boolean equals(final Object o); @Override int hashCode(); }
HostnameMatcher extends HostMatcher { public void setHost(final String host) { this.host = host != null ? host.toLowerCase() : null; }  @Override void validate(final List<Throwable> validationErrors, final Configuration configuration); @Override String toString(); void setHost(final String host); void setAllowSubDomains(final boolean allowSubDomains); @Override boolean equals(final Object o); @Override int hashCode();  }