*/
public void testPublishPtP() {
System.err.println("***PtPTest: Publish a message to a cluster slave ...");
try {
log.info("Login to heron and wait for PtP message ...");
heronCon = serverHelper.connect(serverHelper.getHeronGlob(), new I_Callback() { // Login to xmlBlaster, register for updates
public String update(String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos) {
log.info("Received message '" + updateKey.getOid() + "' state=" +
updateQos.getState() + " from '" + updateQos.getSender() + "'");
if (!updateQos.getSender().equalsAbsolute(bilboCon.getConnectReturnQos().getSessionName())) {
assertInUpdateHeron = serverHelper.getHeronGlob().getId() + ": Did not expect message update in default handler";
}
updateCounterHeron++;
return "";
}
});
try { Thread.sleep(1000); } catch( InterruptedException i) {} // Wait some time
assertTrue(assertInUpdateHeron, assertInUpdateHeron == null);
assertInUpdateHeron = null;
log.info("Login to bilbo to send PtP message ...");
bilboCon = serverHelper.connect(serverHelper.getBilboGlob(), new I_Callback() { // Login to xmlBlaster, register for updates
public String update(String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos) {
assertInUpdateBilbo = serverHelper.getBilboGlob().getId() + ": Should not receive the message '" + updateKey.getOid() + "'";
fail(assertInUpdateBilbo); // This is routed to server, not to junit
return "";
}