Package org.apache.servicemix.wsn.client

Examples of org.apache.servicemix.wsn.client.Subscription


    }

    public void testUnsubscribe() throws Exception {
        // START SNIPPET: sub
        PullPoint pullPoint = wsnCreatePullPoint.createPullPoint();
        Subscription subscription = wsnBroker.subscribe(pullPoint.getEndpoint(), "myTopic", null);
        // END SNIPPET: sub

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(150);

        assertEquals(1, pullPoint.getMessages(0).size());

        subscription.unsubscribe();

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(150);
View Full Code Here


        Thread.sleep(150);
    }

    public void testPauseResume() throws Exception {
        PullPoint pullPoint = wsnCreatePullPoint.createPullPoint();
        Subscription subscription = wsnBroker.subscribe(pullPoint.getEndpoint(), "myTopic", null);

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(150);

        assertEquals(1, pullPoint.getMessages(0).size());

        subscription.pause();

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(150);

        assertEquals(0, pullPoint.getMessages(0).size());

        subscription.resume();

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(150);
View Full Code Here

        Thread.sleep(150);
        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(150);
View Full Code Here

        this.notificationBrokerAddress = notificationBrokerAddress;
    }

    @Override
    protected Object startSubscription() {
        Subscription subscription = null;
        try {
            NotificationBroker broker = new NotificationBroker(getContext());
            broker.setResolver(AbstractWSAClient.resolveWSA(publisherReference));
            subscription = broker.subscribe(AbstractWSAClient.createWSA(notificationBrokerAddress), "noTopic", null);
        } catch (JBIException e) {
View Full Code Here

    }

    public void testUnsubscribe() throws Exception {
        // START SNIPPET: sub
        PullPoint pullPoint = wsnCreatePullPoint.createPullPoint();
        Subscription subscription = wsnBroker.subscribe(pullPoint.getEndpoint(), "myTopic", null);
        // END SNIPPET: sub

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(50);

        assertEquals(1, pullPoint.getMessages(0).size());

        subscription.unsubscribe();

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(50);
View Full Code Here

        Thread.sleep(50);
    }

    public void testPauseResume() throws Exception {
        PullPoint pullPoint = wsnCreatePullPoint.createPullPoint();
        Subscription subscription = wsnBroker.subscribe(pullPoint.getEndpoint(), "myTopic", null);

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(50);

        assertEquals(1, pullPoint.getMessages(0).size());

        subscription.pause();

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(50);

        assertEquals(0, pullPoint.getMessages(0).size());

        subscription.resume();

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(50);
View Full Code Here

        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);
View Full Code Here

    }

    public void testUnsubscribe() throws Exception {
        // START SNIPPET: sub
        PullPoint pullPoint = wsnCreatePullPoint.createPullPoint();
        Subscription subscription = wsnBroker.subscribe(pullPoint.getEndpoint(), "myTopic", null);
        // END SNIPPET: sub

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(timeout);

        assertEquals(1, pullPoint.getMessages(0).size());

        subscription.unsubscribe();

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(timeout);
View Full Code Here

        Thread.sleep(timeout);
    }

    public void testPauseResume() throws Exception {
        PullPoint pullPoint = wsnCreatePullPoint.createPullPoint();
        Subscription subscription = wsnBroker.subscribe(pullPoint.getEndpoint(), "myTopic", null);

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(timeout);

        assertEquals(1, pullPoint.getMessages(0).size());

        subscription.pause();

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(timeout);

        assertEquals(0, pullPoint.getMessages(0).size());

        subscription.resume();

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(timeout);
View Full Code Here

        Thread.sleep(timeout);
        assertNull(publisherComponent.getSubscription());

        PullPoint pullPoint = wsnCreatePullPoint.createPullPoint();
        Subscription subscription = wsnBroker.subscribe(pullPoint.getEndpoint(), "myTopic", null);

        Thread.sleep(timeout);
        assertNotNull(publisherComponent.getSubscription());

        subscription.unsubscribe();

        Thread.sleep(timeout);
        assertNull(publisherComponent.getSubscription());

        Thread.sleep(timeout);
View Full Code Here

TOP

Related Classes of org.apache.servicemix.wsn.client.Subscription

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.