use of org.jgroups.stack.IpAddress in project JGroups by belaban.
the class SizeTest method testIpAddress3.
public static void testIpAddress3() throws Exception {
IpAddress addr = new IpAddress(5555, false);
_testSize(addr);
}
use of org.jgroups.stack.IpAddress in project JGroups by belaban.
the class SizeTest method testIpAddress1.
public static void testIpAddress1() throws Exception {
IpAddress addr = new IpAddress("127.0.0.1", 5555);
_testSize(addr);
}
use of org.jgroups.stack.IpAddress in project JGroups by belaban.
the class SizeTest method testGossipData.
public void testGossipData() throws Exception {
GossipData data;
final Address own = org.jgroups.util.UUID.randomUUID();
final Address coord = org.jgroups.util.UUID.randomUUID();
NameCache.add(own, "own");
NameCache.add(coord, "coord");
PingData pd1 = new PingData(coord, true, "coord", new IpAddress(7400));
PingData pd2 = new PingData(own, true, "own", new IpAddress(7500));
final PhysicalAddress physical_addr_1 = new IpAddress("127.0.0.1", 7500);
_testSize(new GossipData(GossipType.REGISTER));
data = new GossipData(GossipType.REGISTER, "DemoCluster", own, (List<PingData>) null, null);
_testSize(data);
data = new GossipData(GossipType.REGISTER, "DemoCluster", own, Arrays.asList(pd1, pd2), null);
_testSize(data);
data = new GossipData(GossipType.REGISTER, "DemoCluster", own, Arrays.asList(pd2, pd1), physical_addr_1);
_testSize(data);
data = new GossipData(GossipType.REGISTER, "demo", own, "logical_name", null);
_testSize(data);
data = new GossipData(GossipType.REGISTER, "demo", own, new byte[] { 'b', 'e', 'l', 'a' });
_testSize(data);
byte[] buffer = new byte[10];
buffer[2] = 'B';
buffer[3] = 'e';
buffer[4] = 'l';
buffer[5] = 'a';
data = new GossipData(GossipType.REGISTER, "demo", own, buffer, 2, 4);
_testSize(data);
buffer = "hello world".getBytes();
data = new GossipData(GossipType.MESSAGE, "demo", null, buffer, 0, buffer.length);
_testSize(data);
}
use of org.jgroups.stack.IpAddress in project JGroups by belaban.
the class SizeTest method testAddressVector.
public static void testAddressVector() throws Exception {
List<Address> v = new ArrayList<>();
_testSize(v);
v.add(new IpAddress(1111));
_testSize(v);
v.add(new IpAddress(2222));
_testSize(v);
}
use of org.jgroups.stack.IpAddress in project JGroups by belaban.
the class SizeTest method testWriteAddresses.
public static void testWriteAddresses() throws Exception {
List<Address> list = new ArrayList<>();
for (int i = 0; i < 3; i++) list.add(UUID.randomUUID());
_testWriteAddresses(list);
list.clear();
list.add(new IpAddress(7500));
list.add(new IpAddress("192.168.1.5", 4444));
list.add(new IpAddress("127.0.0.1", 5674));
_testWriteAddresses(list);
}
Aggregations