public void testTwoChannelsWithInitialMulticast() throws Exception {
ServerObject obj1, obj2 = null;
Channel c1 = createChannel("A");
obj1 = new ServerObject("obj1");
RpcDispatcher disp1=new RpcDispatcher(c1, null, null, obj1, DEADLOCK_DETECTION);
obj1.setRpcDispatcher(disp1);
c1.connect(name);
Channel c2 = createChannel("A");
obj2 = new ServerObject("obj2");
RpcDispatcher disp2=new RpcDispatcher(c2, null, null, obj2, DEADLOCK_DETECTION);
obj2.setRpcDispatcher(disp2);
c2.connect(name);
Vector<Address> dests=new Vector<Address>();
dests.add(c1.getLocalAddress());
dests.add(c2.getLocalAddress());
try {
// call a point-to-point method on Member 2 that triggers a nested distributed RPC
MethodCall call = new MethodCall("outerMethod", new Object[0], new Class[0]);
log("calling outerMethod() on all members");
RspList rsps = disp1.callRemoteMethods(dests, call, GroupRequest.GET_ALL, 0);
log("results of outerMethod():\n" + rsps);
assertEquals(2, rsps.size());
}
finally {
c2.close();
c1.close();
}
}