예제 #1
0
 private void logVersion(final QueryExecutorConfiguration configuration) throws IOException {
   final DummyWhoisClient client =
       new DummyWhoisClient(configuration.getHost(), configuration.getPort());
   final String response = client.sendQuery("-q version");
   final Matcher matcher = WHOIS_SERVER_PATTERN.matcher(response);
   if (!matcher.find()) {
     throw new RuntimeException(
         "version string not found in whois query response of " + configuration.getIdentifier());
   }
   LOGGER.warn(
       " ***** Server {} is running version {} ***** ",
       configuration.getIdentifier(),
       matcher.group(1));
 }
  private void references_self(final String query) {
    final String response = DummyWhoisClient.query(QueryServer.port, query);
    System.err.println(response);

    final String check = "role:           Asia Pacific Network Information Centre\n";
    assertThat(response, containsString(check));
    assertTrue(
        "Object should appear only once", response.indexOf(check) == response.lastIndexOf(check));
  }