@Test
public void WorkflowTrackingtest() throws Exception{
logger.info("Running WorkflowTrackingTest...");
setUp();
Properties configurations = new Properties(getDefaults());
WseMsgBrokerClient brokerClient = new WseMsgBrokerClient();
String brokerLocation = "http://localhost:" + TestUtilServer.TESTING_PORT + "/axis2/services/EventingService";
brokerClient.init(brokerLocation);
String topic = configurations.getProperty(ConfigKeys.TOPIC);
NotificationSender sender = null;
sender = new NotificationSender(brokerLocation, topic);
int consumerPort = TestUtilServer.getAvailablePort();
String[] consumerEPRs = brokerClient.startConsumerService(consumerPort, this);
// subscribing to the above created messsage box with configured topic
String subscriptionID = brokerClient.subscribe(consumerEPRs[0], topic, null);
sender.workflowStarted("Workflow Started");
//Here we simply assume the workflow invocation is the invoke of the subscribe operation of EventingService and result
// Is considered as the subscriptionID got from subscribe operation
try {
Thread.sleep(10000L);
} catch (InterruptedException e) {
e.printStackTrace();
}
brokerClient.unSubscribe(subscriptionID);
Assert.assertEquals(brokerLocation,"http://localhost:" + TestUtilServer.TESTING_PORT + "/axis2/services/EventingService");
tearDown();
}