PullPoint pullPoint = wsnCreatePullPoint.createPullPoint(); Subscription subscription = wsnBroker.subscribe(pullPoint.getEndpoint(), "myTopic", null);
Thread.sleep(50); assertNull(publisherComponent.getSubscription());
	public void testDemandBasedPublisher() throws Exception {		PublisherComponent publisherComponent = new PublisherComponent();        publisherComponent.setService(new QName("http://servicemix.org/example", "publisher"));        publisherComponent.setEndpoint("publisher");        publisherComponent.setTopic("myTopic");        publisherComponent.setDemand(true);		jbi.activateComponent(publisherComponent, "publisher");				Thread.sleep(50);		assertNull(publisherComponent.getSubscription());		PullPoint pullPoint = wsnCreatePullPoint.createPullPoint();		Subscription subscription = wsnBroker.subscribe(pullPoint.getEndpoint(), "myTopic", null);		Thread.sleep(500);		assertNotNull(publisherComponent.getSubscription());				subscription.unsubscribe();				Thread.sleep(500);		assertNull(publisherComponent.getSubscription());				Thread.sleep(50);	}