System.clearProperty("javax.xml.ws.spi.Provider");
}
public void testBroker() throws Exception {
TestConsumer callback = new TestConsumer();
Consumer consumer = new Consumer(callback, "http://localhost:" + port2 + "/test/consumer");
Subscription subscription = notificationBroker.subscribe(consumer, "myTopic");
synchronized (callback.notifications) {
notificationBroker.notify("myTopic",
new JAXBElement<String>(new QName("urn:test:org", "foo"),
String.class, "bar"));
callback.notifications.wait(1000000);
}
assertEquals(1, callback.notifications.size());
NotificationMessageHolderType message = callback.notifications.get(0);
assertEquals(WSNHelper.getWSAAddress(subscription.getEpr()),
WSNHelper.getWSAAddress(message.getSubscriptionReference()));
subscription.unsubscribe();
consumer.stop();
}