subscription.unsubscribe();
consumer.stop();
}
public void testPullPoint() throws Exception {
PullPoint pullPoint = createPullPoint.create();
Subscription subscription = notificationBroker.subscribe(pullPoint, "myTopic");
notificationBroker.notify("myTopic",
new JAXBElement<String>(new QName("urn:test:org", "foo"),
String.class, "bar"));
boolean received = false;
for (int i = 0; i < 50; i++) {
List<NotificationMessageHolderType> messages = pullPoint.getMessages(10);
if (!messages.isEmpty()) {
received = true;
break;
}
Thread.sleep(100);
}
assertTrue(received);
subscription.unsubscribe();
pullPoint.destroy();
}