mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
HCOLL-134 ( release draft cut of the code so that I can test it across my network )
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
package net.openhft.chronicle.map;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class NodeDiscoveryBroadcasterTest extends TestCase {
|
||||
|
||||
@@ -8,93 +12,25 @@ public class NodeDiscoveryBroadcasterTest extends TestCase {
|
||||
// test to stop it erroring with no test
|
||||
}
|
||||
|
||||
|
||||
/* @Test
|
||||
@Ignore
|
||||
public void test() throws IOException, InterruptedException {
|
||||
|
||||
final UdpReplicationConfig udpConfig = UdpReplicationConfig
|
||||
.simple(Inet4Address.getByName("255.255.255.255"), 1235);
|
||||
|
||||
final Bytes identifierBitSetBits = new ByteBufferBytes(ByteBuffer.allocate(128 / 8));
|
||||
|
||||
final RemoteNodes remoteNodes = new RemoteNodes(identifierBitSetBits);
|
||||
|
||||
UDPEventListener udpEventListener = new UDPEventListener() {
|
||||
|
||||
@Override
|
||||
public void onRemoteNodeEvent(RemoteNodes allNodes, byte remoteProposedId) {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
BytesExternalizableImpl externalizable = new BytesExternalizableImpl(remoteNodes, udpEventListener);
|
||||
private ChronicleMap<Integer, CharSequence> map1;
|
||||
private ChronicleMap<Integer, CharSequence> map2;
|
||||
private volatile byte proposedIdentifier = 1;
|
||||
private volatile boolean useAnotherIdentifer = false;
|
||||
|
||||
|
||||
final NodeDiscoveryBroadcaster nodeDiscoveryBroadcaster
|
||||
= new NodeDiscoveryBroadcaster(udpConfig, 1024, externalizable);
|
||||
|
||||
externalizable.setModificationNotifier(nodeDiscoveryBroadcaster);
|
||||
|
||||
|
||||
Thread.sleep(1000);
|
||||
|
||||
externalizable.sendBootStrap();
|
||||
|
||||
externalizable.add(new InetSocketAddress("myhost", 8888));
|
||||
externalizable.add(new InetSocketAddress("myOtherHost", 8888));
|
||||
externalizable.add((byte) 2);
|
||||
externalizable.onChange();
|
||||
Thread.sleep(10000);
|
||||
externalizable.add((byte) 2);
|
||||
externalizable.onChange();
|
||||
Thread.sleep(10000);
|
||||
externalizable.add((byte) 3);
|
||||
externalizable.onChange();
|
||||
Thread.sleep(10000);
|
||||
externalizable.add((byte) 4);
|
||||
externalizable.onChange();
|
||||
Thread.sleep(10000);
|
||||
externalizable.add((byte) 1);
|
||||
externalizable.onChange();
|
||||
Thread.sleep(10000);
|
||||
externalizable.onChange();
|
||||
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void testJustListen() throws IOException, InterruptedException {
|
||||
public void test2() throws IOException, InterruptedException {
|
||||
|
||||
final UdpReplicationConfig udpConfig = UdpReplicationConfig
|
||||
.simple(Inet4Address.getByName("255.255.255.255"), 1235);
|
||||
DiscoveryCluster discoveryCluster = new DiscoveryCluster();
|
||||
|
||||
final Bytes identifierBitSetBits = new ByteBufferBytes(ByteBuffer.allocate(128 / 8));
|
||||
|
||||
final RemoteNodes remoteNodes = new RemoteNodes(identifierBitSetBits);
|
||||
|
||||
UDPEventListener udpEventListener = new UDPEventListener() {
|
||||
|
||||
@Override
|
||||
public void onRemoteNodeEvent(RemoteNodes allNodes, byte remoteProposedId) {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
BytesExternalizableImpl externalizable = new BytesExternalizableImpl(remoteNodes, udpEventListener);
|
||||
ChronicleMap<Integer, CharSequence> map = discoveryCluster.discoverMap(1025, 8086);
|
||||
}
|
||||
|
||||
|
||||
final NodeDiscoveryBroadcaster nodeDiscoveryBroadcaster
|
||||
= new NodeDiscoveryBroadcaster(udpConfig, 1024, externalizable);
|
||||
|
||||
externalizable.setModificationNotifier(nodeDiscoveryBroadcaster);
|
||||
|
||||
|
||||
Thread.sleep(10000000);
|
||||
|
||||
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user