use of com.hazelcast.util.AddressUtil.Ip4AddressMatcher in project hazelcast by hazelcast.
the class AddressUtilTest method testAddressMatcher.
@Test
public void testAddressMatcher() {
AddressMatcher address;
address = AddressUtil.getAddressMatcher("fe80::62c5:*:fe05:480a%en0");
assertTrue(address.isIPv6());
assertEquals("fe80:0:0:0:62c5:*:fe05:480a", address.getAddress());
address = AddressUtil.getAddressMatcher("192.168.1.1");
assertTrue(address instanceof Ip4AddressMatcher);
assertEquals("192.168.1.1", address.getAddress());
address = AddressUtil.getAddressMatcher("::ffff:192.0.2.128");
assertTrue(address.isIPv4());
assertEquals("192.0.2.128", address.getAddress());
}
Aggregations