* thread. Note that the suggested fix on JGRP-1522 will solve this. Issue: https://issues.jboss.org/browse/JGRP-1522
*/
@BMScript(dir="scripts/BecomeServerTest", value="testSendingOfMsgsOnUnconnectedChannel")
public void testSendingOfMsgsOnUnconnectedChannel() throws Exception {
a=createChannel("A");
a.setReceiver(new ReceiverAdapter() {
public void receive(Message msg) {
System.out.println("A: received message from " + msg.getSrc() + ": " + msg.getObject());
}
});
a.connect("BecomeServerTest");
new Thread("MsgSender-A") {
public void run() {
sendMessage(a, "hello from A"); // will be blocked by byteman rendezvous
}
}.start();
b=createChannel("B");
b.setReceiver(new ReceiverAdapter() {
public void receive(Message msg) {
System.out.println("B: received message from " + msg.getSrc() + ": " + msg.getObject());
if(msg.getSrc().equals(a.getAddress())) {
try {
b.send(null, "This message would trigger an exception if the channel was not yet connected");