@Test public void testHostMatcher() { assertThat(matcher.getMatchingHosts(group("role=foo")), contains("foo-a1", "foo-a2")); assertThat(matcher.getMatchingHosts(group("role=foo", "special=yes")), contains("foo-a2")); assertThat(matcher.getMatchingHosts(group("role=foo", "special!=yes")), empty()); assertThat(matcher.getMatchingHosts(group("pool=a")), contains("bar-a1")); assertThat(matcher.getMatchingHosts(group("pool=a", "role=bar")), contains("bar-a1")); assertThat(matcher.getMatchingHosts(group("pool=b")), contains("bar-b1")); assertThat(matcher.getMatchingHosts(group("pool=b", "role=bar")), contains("bar-b1")); assertThat(matcher.getMatchingHosts(group("pool=c")), contains("bar-c1")); assertThat(matcher.getMatchingHosts(group("pool=c", "role=bar")), contains("bar-c1")); assertThat(matcher.getMatchingHosts(group("pool=c", "role=awesome")), empty()); assertThat(matcher.getMatchingHosts(group("special=yes", "role=awesome")), empty()); }
public HostMatcher(final Map<String, Map<String, String>> hostsAndLabels) { this.hostsAndLabels = ImmutableMap.copyOf(checkNotNull(hostsAndLabels, "hostsAndLabels")); }
HostMatcher { public HostMatcher(final Map<String, Map<String, String>> hostsAndLabels) { this.hostsAndLabels = ImmutableMap.copyOf(checkNotNull(hostsAndLabels, "hostsAndLabels")); } }
HostMatcher { public HostMatcher(final Map<String, Map<String, String>> hostsAndLabels) { this.hostsAndLabels = ImmutableMap.copyOf(checkNotNull(hostsAndLabels, "hostsAndLabels")); } HostMatcher(final Map<String, Map<String, String>> hostsAndLabels); }
HostMatcher { public HostMatcher(final Map<String, Map<String, String>> hostsAndLabels) { this.hostsAndLabels = ImmutableMap.copyOf(checkNotNull(hostsAndLabels, "hostsAndLabels")); } HostMatcher(final Map<String, Map<String, String>> hostsAndLabels); List<String> getMatchingHosts(final DeploymentGroup deploymentGroup); List<String> getMatchingHosts(final List<HostSelector> selectors); }
HostMatcher { public HostMatcher(final Map<String, Map<String, String>> hostsAndLabels) { this.hostsAndLabels = ImmutableMap.copyOf(checkNotNull(hostsAndLabels, "hostsAndLabels")); } HostMatcher(final Map<String, Map<String, String>> hostsAndLabels); List<String> getMatchingHosts(final DeploymentGroup deploymentGroup); List<String> getMatchingHosts(final List<HostSelector> selectors);  }