use of org.rx.net.nameserver.NameserverClient in project rxlib by RockyLOMO.
the class SocksTester method multiNode2.
@Test
public void multiNode2() {
NameserverClient c1 = new NameserverClient(appUsercenter);
NameserverClient c2 = new NameserverClient(appOrder);
c1.registerAsync(node1).join();
c2.registerAsync(node2).join();
assert !c1.registerEndpoints().containsAll(c2.registerEndpoints());
ns2.syncRegister(c1.registerEndpoints());
sleep4Sync();
System.out.println(toJsonString(c1.registerEndpoints()));
assert c1.registerEndpoints().containsAll(c2.registerEndpoints());
}
use of org.rx.net.nameserver.NameserverClient in project rxlib by RockyLOMO.
the class SocksTester method multiNode1.
@Test
public void multiNode1() {
NameserverClient c1 = new NameserverClient(appUsercenter);
NameserverClient c2 = new NameserverClient(appOrder);
c1.registerAsync(node1).join();
c2.registerAsync(node2, node1).join();
sleep4Sync();
System.out.println("c1: " + toJsonString(c1.registerEndpoints()));
assert c1.registerEndpoints().containsAll(c2.registerEndpoints());
c2.deregisterAsync().join();
sleep4Sync();
List<InetAddress> discover = c1.discover(appOrder);
assert CollectionUtils.isEmpty(discover);
}
use of org.rx.net.nameserver.NameserverClient in project rxlib by RockyLOMO.
the class SocksTester method singleClient.
@SneakyThrows
@Test
public void singleClient() {
NameserverClient c1 = new NameserverClient(appUsercenter);
c1.registerAsync(node1, node2);
c1.wait4Inject();
sleep4Sync();
System.out.println("x:" + ns1.getDnsServer().getHosts());
System.out.println("x2:" + ns2.getDnsServer().getHosts());
}
use of org.rx.net.nameserver.NameserverClient in project rxlib by RockyLOMO.
the class SocksTester method singleNode.
@Test
public void singleNode() {
NameserverClient c1 = new NameserverClient(appUsercenter);
NameserverClient c2 = new NameserverClient(appOrder);
c1.registerAsync(node1).join();
List<InetAddress> discover = c1.discover(appUsercenter);
System.out.println(toJsonString(discover));
assert discover.contains(Sockets.loopbackAddress());
discover = c1.discover(appOrder);
assert CollectionUtils.isEmpty(discover);
c2.registerAsync(node1).join();
discover = c1.discover(appOrder);
assert discover.contains(Sockets.loopbackAddress());
c2.deregisterAsync().join();
discover = c1.discover(appOrder);
assert CollectionUtils.isEmpty(discover);
}
Aggregations