use of org.apache.cxf.wsn.client.PullPoint in project cxf by apache.
the class WsnBrokerTest method testPullPoint.
@Test
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();
}
use of org.apache.cxf.wsn.client.PullPoint in project cxf by apache.
the class WsnBrokerTest method testPullPointWithQueueName.
@Test
public void testPullPointWithQueueName() throws Exception {
PullPoint pullPoint = createPullPoint.create("testQueue");
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();
}
Aggregations