Package org.apache.servicemix.tck

Examples of org.apache.servicemix.tck.ReceiverComponent


       
        listener.assertExchangeCompleted();
    }
   
    public void testInOptionalOutNoAnswer() throws Exception {
        activateComponent(new ReceiverComponent(), "target");

        InOptionalOut me = client.createInOptionalOutExchange();
        me.setService(new QName("wireTap"));
        me.getInMessage().setContent(createSource("<hello/>"));
        client.sendSync(me);
View Full Code Here


    protected List<String> blackList;

    protected void setUp() throws Exception {
        super.setUp();

        ReceiverComponent rec = new ReceiverComponent();
        rec.setService(new QName("receiver"));
        rec.setEndpoint("endpoint");
        container.activateComponent(rec, "receiver");
        receiver = rec;

        EchoComponent echo = new EchoComponent();
        echo.setService(new QName("echo"));
View Full Code Here

        endpoint.setPojo(new ComplexPojoImpl());
        endpoint.setServiceInterface(ComplexPojo.class.getName());
        component.setEndpoints(new Jsr181Endpoint[] {endpoint });
        container.activateComponent(component, "JSR181Component");
       
        ReceiverComponent receiver = new ReceiverComponent();
        container.activateComponent(receiver, "Receiver");
       
        container.start();

        DefaultServiceMixClient client = new DefaultServiceMixClient(container);
View Full Code Here

        endpoint.setRuleBaseResource(new ClassPathResource("chained.drl"));
       
        drools.setEndpoints(new DroolsEndpoint[] {endpoint});
        jbi.activateComponent(drools, "servicemix-drools");

        ReceiverComponent target = new ReceiverComponent();
        target.setService(new QName("smx", "target"));
        target.setEndpoint("endpoint");
       
        jbi.activateComponent(target, "target");
       
        jbi.start();
       
View Full Code Here

                                                     new QName("drools"), "endpoint");
        endpoint.setRuleBaseResource(new ClassPathResource("router.drl"));
        drools.setEndpoints(new DroolsEndpoint[] {endpoint });
        jbi.activateComponent(drools, "servicemix-drools");
       
        ReceiverComponent r1 = new ReceiverComponent(new QName("target1"), "endpoint");
        ReceiverComponent r2 = new ReceiverComponent(new QName("target2"), "endpoint");
        ReceiverComponent r3 = new ReceiverComponent(new QName("target3"), "endpoint");
        jbi.activateComponent(r1, "receiver1");
        jbi.activateComponent(r2, "receiver2");
        jbi.activateComponent(r3, "receiver3");
       
        jbi.start();
       
        InOnly me = client.createInOnlyExchange();
        me.setService(new QName("drools"));
        me.getInMessage().setContent(new StringSource("<test id='0' />"));
        client.sendSync(me);
        assertEquals(ExchangeStatus.ERROR, me.getStatus());
       
        me = client.createInOnlyExchange();
        me.setService(new QName("drools"));
        me.getInMessage().setContent(new StringSource("<test id='1' />"));
        client.sendSync(me);

        me = client.createInOnlyExchange();
        me.setService(new QName("drools"));
        me.getInMessage().setContent(new StringSource("<test id='2' />"));
        client.sendSync(me);
       
        me = client.createInOnlyExchange();
        me.setService(new QName("drools"));
        me.getInMessage().setContent(new StringSource("<test id='3' />"));
        me.getInMessage().setProperty("prop", Boolean.TRUE);
        client.sendSync(me);
       
        me = client.createInOnlyExchange();
        me.setService(new QName("drools"));
        me.getInMessage().setContent(new StringSource("<test id='4' />"));
        client.sendSync(me);
        assertEquals(ExchangeStatus.ERROR, me.getStatus());
       
        r1.getMessageList().assertMessagesReceived(1);
        r2.getMessageList().assertMessagesReceived(1);
        r3.getMessageList().assertMessagesReceived(1);
       
        Thread.sleep(50);
    }
View Full Code Here

        final SenderComponent sender = new SenderComponent();
        sender.setResolver(new ServiceNameEndpointResolver(ReceiverComponent.SERVICE));
        final Receiver receiver;
        final Map delivered = new ConcurrentHashMap();
        if (syncReceive) {
            receiver = new ReceiverComponent() {
                public void onMessageExchange(MessageExchange exchange) throws MessagingException {
                    try {
                        if (delivered.get(exchange.getExchangeId()) == null) {
                            AbstractPersistenceTest.LOGGER.info("Message delivery rolled back: {}", exchange.getExchangeId());
                            delivered.put(exchange.getExchangeId(), Boolean.TRUE);
View Full Code Here

        AuthorizationMap map = new DefaultAuthorizationMap(entries);
        SecuredBroker broker = new SecuredBroker(map);
        jbi.setBroker(broker);
        jbi.init();
       
        receiver = new ReceiverComponent();
        jbi.activateComponent(receiver, "receiver");

        jbi.start();
    }
View Full Code Here

    protected void tearDown() throws Exception {
        container.shutDown();
    }

    public void testPubSub() throws Exception {
        ReceiverComponent recListener = new ReceiverComponent();
        container.activateComponent(createReceiverAS("receiver", recListener));
        sender.sendMessages(1);
        recListener.getMessageList().assertMessagesReceived(1);
    }
View Full Code Here

        sender.sendMessages(1);
        recListener.getMessageList().assertMessagesReceived(1);
    }

    public void testPubSubFiltered() throws Exception {
        ReceiverComponent recListener = new ReceiverComponent();
        container.activateComponent(createReceiverASFiltered("receiver", recListener));
        sender.sendMessages(1, false);
        recListener.getMessageList().assertMessagesReceived(1);
    }
View Full Code Here

    }
   
    public void testNamespaces() throws Exception {
        ActivationSpec as = new ActivationSpec();
        as.setId("receiver");
        ReceiverComponent receiver = new ReceiverComponent();
        as.setComponent(receiver);
        as.setService(new QName("receiver"));
        container.activateComponent(as);
       
        as = new ActivationSpec();
        as.setId("http");
        as.setDestinationService(new QName("receiver"));
        HttpSoapConnector http = new HttpSoapConnector();
        http.setDefaultInOut(false);
        http.setPort(8100);
        as.setComponent(http);
        container.activateComponent(as);

        URLConnection connection = new URL("http://localhost:8100").openConnection();
        connection.setDoOutput(true);
        connection.setDoInput(true);
        OutputStream os = connection.getOutputStream();
        // Post the request file.
        InputStream fis = getClass().getResourceAsStream("soap-response.xml");
        FileUtil.copyInputStream(fis, os);
        connection.getInputStream();
       
        receiver.getMessageList().assertMessagesReceived(1);
        NormalizedMessage msg = (NormalizedMessage) receiver.getMessageList().flushMessages().get(0);

        Node node = new SourceTransformer().toDOMNode(new SourceTransformer().toStreamSource(msg.getContent()));
        logger.info(new SourceTransformer().toString(node));
       
        CachedXPathAPI cachedXPathAPI = new CachedXPathAPI();
View Full Code Here

TOP

Related Classes of org.apache.servicemix.tck.ReceiverComponent

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.