// Wait for acks to be processed
Thread.sleep(150);
}
public void testPullWithFilter() throws Exception {
PullPoint pullPoint1 = wsnCreatePullPoint.createPullPoint();
PullPoint pullPoint2 = wsnCreatePullPoint.createPullPoint();
wsnBroker.subscribe(pullPoint1.getEndpoint(), "myTopic", "@type = 'a'");
wsnBroker.subscribe(pullPoint2.getEndpoint(), "myTopic", "@type = 'b'");
wsnBroker.notify("myTopic", parse("<msg type='a'/>"));
// Wait for notification
Thread.sleep(500);
assertEquals(1, pullPoint1.getMessages(0).size());
assertEquals(0, pullPoint2.getMessages(0).size());
wsnBroker.notify("myTopic", parse("<msg type='b'/>"));
// Wait for notification
Thread.sleep(500);
assertEquals(0, pullPoint1.getMessages(0).size());
assertEquals(1, pullPoint2.getMessages(0).size());
wsnBroker.notify("myTopic", parse("<msg type='c'/>"));
// Wait for notification
Thread.sleep(500);
assertEquals(0, pullPoint1.getMessages(0).size());
assertEquals(0, pullPoint2.getMessages(0).size());
}