Examples of PullPoint


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

        jbi.activateComponent(publisherComponent, "publisher");

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

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

        wsnComponent.getServiceUnitManager().deploy("pullpoint", path.getAbsolutePath());

        wsnComponent.getServiceUnitManager().start("pullpoint");

        wsnBroker.notify("myTopic", parse("<hello>world</hello>"));
        PullPoint pullPoint = new PullPoint(
                        AbstractWSAClient.createWSA("http://www.consumer.org/service/endpoint"),
                        jbi);
        Thread.sleep(150);
        assertEquals(1, pullPoint.getMessages(0).size());
    }
View Full Code Here

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

        Thread.sleep(50);
    }

    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);

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

        // Wait for acks to be processed
        Thread.sleep(50);
    }
View Full Code Here

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

        // Wait for acks to be processed
        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);

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

        // Wait for acks to be processed
        Thread.sleep(50);
    }
View Full Code Here

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

        // Wait for acks to be processed
        Thread.sleep(50);
    }

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

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

        List<NotificationMessageHolderType> msgs = pullPoint.getMessages(0);
        assertNotNull(msgs);
        assertEquals(1, msgs.size());

        // Wait for acks to be processed
        Thread.sleep(50);
View Full Code Here

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

        // Wait for acks to be processed
        Thread.sleep(50);
    }

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

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

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

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

        wsnComponent.getServiceUnitManager().deploy("pullpoint", path.getAbsolutePath());

        wsnComponent.getServiceUnitManager().start("pullpoint");

        wsnBroker.notify("myTopic", parse("<hello>world</hello>"));
        PullPoint pullPoint = new PullPoint(
                        AbstractWSAClient.createWSA("http://www.consumer.org/service/endpoint"),
                        jbi);
        Thread.sleep(50);
        assertEquals(1, pullPoint.getMessages(0).size());
    }
View Full Code Here

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

        Thread.sleep(timeout);
    }

    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);

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

        // Wait for acks to be processed
        Thread.sleep(timeout);
    }
View Full Code Here

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

        // Wait for acks to be processed
        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);

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

        // Wait for acks to be processed
        Thread.sleep(timeout);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.