Search in sources :

Example 1 with IpAddressUUID

use of org.jgroups.stack.IpAddressUUID in project JGroups by belaban.

the class IpAddressTest method testInequality.

public void testInequality() throws Exception {
    IpAddress tmp = null;
    assert !a.equals(d);
    assert !c.equals(d);
    assert !a.equals(f);
    assert !e.equals(f);
    assert !f.equals(g);
    assert !(a.equals(tmp));
    tmp = new IpAddressUUID("localhost", 5555);
    assert a.equals(tmp);
    assert tmp.equals(a);
}
Also used : IpAddress(org.jgroups.stack.IpAddress) IpAddressUUID(org.jgroups.stack.IpAddressUUID)

Example 2 with IpAddressUUID

use of org.jgroups.stack.IpAddressUUID in project JGroups by belaban.

the class IpAddressTest method testEquality.

public void testEquality() throws Exception {
    Assert.assertEquals(a, b);
    Assert.assertEquals(c, b);
    Assert.assertEquals(a, e);
    Assert.assertEquals(c, e);
    assert !j.equals(k);
    assert !k.equals(j);
    assert a.equals(j);
    assert j.equals(a);
    IpAddress tmp = new IpAddressUUID("localhost", 5555);
    assert !tmp.equals(j);
}
Also used : IpAddress(org.jgroups.stack.IpAddress) IpAddressUUID(org.jgroups.stack.IpAddressUUID)

Example 3 with IpAddressUUID

use of org.jgroups.stack.IpAddressUUID in project JGroups by belaban.

the class IpAddressTest method testCompareTo.

public void testCompareTo() throws UnknownHostException {
    Assert.assertEquals(0, a.compareTo(b));
    assert a.compareTo(d) < 0;
    assert d.compareTo(a) > 0;
    assert j.compareTo(k) != 0;
    IpAddressUUID tmp = new IpAddressUUID("localhost", 5556);
    assert tmp.compareTo(j) != 0;
    tmp = new IpAddressUUID("localhost", 5555);
    assert tmp.compareTo(j) != 0;
    assert tmp.compareTo(a) == 0;
    assert a.compareTo(tmp) == 0;
}
Also used : IpAddressUUID(org.jgroups.stack.IpAddressUUID)

Example 4 with IpAddressUUID

use of org.jgroups.stack.IpAddressUUID in project wildfly by wildfly.

the class AddressSerializerTestCase method test.

private static void test(Tester<Address> tester) throws IOException {
    UUID uuid = UUID.randomUUID();
    InetSocketAddress address = new InetSocketAddress(InetAddress.getLoopbackAddress(), Short.MAX_VALUE);
    IpAddress ipAddress = new IpAddress(address);
    IpAddressUUID ipAddressUUID = new IpAddressUUID(address);
    tester.test(uuid);
    tester.test(ipAddress);
    tester.test(ipAddressUUID);
}
Also used : InetSocketAddress(java.net.InetSocketAddress) IpAddress(org.jgroups.stack.IpAddress) UUID(org.jgroups.util.UUID) IpAddressUUID(org.jgroups.stack.IpAddressUUID) IpAddressUUID(org.jgroups.stack.IpAddressUUID)

Aggregations

IpAddressUUID (org.jgroups.stack.IpAddressUUID)4 IpAddress (org.jgroups.stack.IpAddress)3 InetSocketAddress (java.net.InetSocketAddress)1 UUID (org.jgroups.util.UUID)1