private boolean wait = true;
public void testMessagePulling() throws Exception {
Subscription subscription = null;
Callback testCallback1 = new Callback() {
public void deliverMessage(String topic, NotificationType type, XmlObject messageObj) {
System.out.println("Notification Received, notification of type:" + type);
// assertEquals(type, NotificationType.WorkflowInitialized);
wait = false;
}
};
subscription = LeadNotificationManager.createMessageBoxSubscription(MESSAGEBOX_URL, BROKER_URL, TEST_TOPIC,
null, testCallback1);
System.out.println(subscription.getMessageBoxEPR());
System.out.println(subscription.getSubscriptionID());
WseMsgBrokerClient client = new WseMsgBrokerClient();
client.init(BROKER_URL);
OMElement msg = WorkFlowUtils.reader2OMElement(new StringReader(CommonUtils.WORKFLOW_INITIALIZED_NOTIFICATION));
client.publish(TEST_TOPIC, msg);
EndpointReference MSG_BOX_EPR = subscription.getMessageBoxEPR();
System.out.println(MSG_BOX_EPR);
String subscriptionID = subscription.getSubscriptionID();
Callback testCallback2 = new Callback() {
public void deliverMessage(String topic, NotificationType type, XmlObject messageObj) {
System.out.println("Notification Received, notification of type:" + type);
// This assertion is wrong because type and NotificationType.WorkflowInitialized are two different types