InetSocketAddressConverter { public static InetSocketAddress getInetSocketAddress(String server) { return getInetSocketAddress(server, 9410); }  static InetSocketAddress getInetSocketAddress(String server); static InetSocketAddress getInetSocketAddress(String hostPort, int defaultPort); static List<InetSocketAddress> getInetSocketAddresses(String[] servers); static List<InetSocketAddress> getInetSocketAddresses(String[] servers, int defaultPort); static String toHostPort(InetSocketAddress address);  }
@Test(expected = IllegalArgumentException.class) public void validateHostPortList_notok_hostname_1() { InetSocketAddressConverter.getInetSocketAddress("some_host"); }
@Test(expected = IllegalArgumentException.class) public void validateHostPortList_notok_hostname_2() { InetSocketAddressConverter.getInetSocketAddress("%%%@@^^***"); }
@Test(expected = IllegalArgumentException.class) public void validateHostPortList_notok_ipv4_1() { InetSocketAddressConverter.getInetSocketAddress("abc.10.10.%%^"); }
@Test(expected = IllegalArgumentException.class) public void validateHostPortList_notok_ipv4_2() { InetSocketAddressConverter.getInetSocketAddress(""); }
@Test(expected = IllegalArgumentException.class) public void validateHostPortList_notok_ipv4_3() { InetSocketAddressConverter.getInetSocketAddress(":9510"); }
@Test(expected = IllegalArgumentException.class) public void validateHostPortList_notok_ipv6_1() { InetSocketAddressConverter.getInetSocketAddress("aaaa:aaaa:aaaa:aaaa"); }
@Test(expected = IllegalArgumentException.class) public void validateHostPortList_notok_ipv6_2() { InetSocketAddressConverter.getInetSocketAddress("aaaa:aaaa:aaaa:aaaa:aaaa:aaaa:aaaa:aaaa:aaaa:aaaa:aaaa:aaaa"); }
@Test(expected = IllegalArgumentException.class) public void validateHostPortList_notok_ipv6_3() { InetSocketAddressConverter.getInetSocketAddress("zzzz:aaaa:aaaa:nnnn:aaaa:aaaa:aaaa:zzzz"); }
@Test(expected = IllegalArgumentException.class) public void validateHostPortList_notok_ipv6_4() { InetSocketAddressConverter.getInetSocketAddress("2001:db8:a0b::12f0::1"); }
@Test(expected = IllegalArgumentException.class) public void validateHostPortList_notok_ipv6_5() { InetSocketAddressConverter.getInetSocketAddress("2001:db8:a0b:12f0:::1"); }
@Test(expected = IllegalArgumentException.class) public void validateHostPortList_notok_ipv6_6() { InetSocketAddressConverter.getInetSocketAddress("2001:1:1:1:1:1:1:1:9510"); }
@Test(expected = IllegalArgumentException.class) public void validateHostPortList_notok_ipv6_7() { InetSocketAddressConverter.getInetSocketAddress("[]:9510"); }
@Test(expected = IllegalArgumentException.class) public void validateHostPortList_notok_too_many_ports_1() { InetSocketAddressConverter.getInetSocketAddress("host:12:12:1212"); }
@Test(expected = IllegalArgumentException.class) public void validateHostPortList_notok_too_many_ports_2() { InetSocketAddressConverter.getInetSocketAddress("10.10.10.10:12:12"); }
@Test(expected = IllegalArgumentException.class) public void validateHostPortList_notok_too_many_ports_3() { InetSocketAddressConverter.getInetSocketAddress("2001:db8:a0b:12f0:0:0:0:1:12:12"); }
@Test(expected = IllegalArgumentException.class) public void validateHostPortList_notok_faulty_port_1() { InetSocketAddressConverter.getInetSocketAddress("host:12121212"); }
@Test(expected = IllegalArgumentException.class) public void validateHostPortList_notok_faulty_port_2() { InetSocketAddressConverter.getInetSocketAddress("host:-1"); }
@Test(expected = IllegalArgumentException.class) public void validateHostPortList_notok_faulty_port_3() { InetSocketAddressConverter.getInetSocketAddress("host:blah"); }