Package org.apache.servicemix.nmr.api

Examples of org.apache.servicemix.nmr.api.Channel.send()


                assertNotNull(onBefalfsubject);
                assertEquals(onBefalfsubject, receivedSubject);
            }
        };
        destination.setMessageObserver(observer);
        channel.send(exchange);      
        Thread.sleep(2000);
        assertNotNull(inMessage);
    }
}
View Full Code Here


        listener.exchangeFailed(same(e));

        replay(listener);

        try {
            channel.send(e);
            fail("Exepected an exception to be thrown");
        } catch (ServiceMixException t) {
            // ok
        }
View Full Code Here

        exchange.getIn().setBody(new StringSource("<hello/>"));
        exchange.setTarget(nmr1.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME, PROXY_ENDPOINT_NAME)));
        assertTrue("sendSync failed for exchange " + exchange.getId(), client.sendSync(exchange));
        assertEquals("bad status for exchange " + exchange.getId(), Status.Active, exchange.getStatus());
        exchange.setStatus(Status.Done);
        client.send(exchange);
        client.close();
        receiver.assertExchangesReceived(2, TIMEOUT);
    }

    public void testInOutNoTxNoRbInError() throws Exception {
View Full Code Here

        exchange.getIn().setBody(new StringSource("<hello/>"));
        exchange.setTarget(nmr1.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME, PROXY_ENDPOINT_NAME)));
        assertTrue("sendSync failed for exchange " + exchange.getId(), client.sendSync(exchange));
        assertEquals("bad status for exchange " + exchange.getId(), Status.Active, exchange.getStatus());
        exchange.setStatus(Status.Done);
        client.send(exchange);
        client.close();
        receiver.assertExchangesReceived(2, TIMEOUT);
    }

    public void testInOutNoTxRbInError() throws Exception {
View Full Code Here

        exchange.getIn().setBody(new StringSource("<hello/>"));
        exchange.setTarget(nmr1.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME, PROXY_ENDPOINT_NAME)));
        assertTrue("sendSync failed for exchange " + exchange.getId(), client.sendSync(exchange));
        assertEquals("bad status for exchange " + exchange.getId(), Status.Active, exchange.getStatus());
        exchange.setStatus(Status.Done);
        client.send(exchange);
        client.close();
        receiver.assertExchangesReceived(2, TIMEOUT);
    }

    public void testInOutJmsTxNoRbInError() throws Exception {
View Full Code Here

        exchange.getIn().setBody(new StringSource("<hello/>"));
        exchange.setTarget(nmr1.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME, PROXY_ENDPOINT_NAME)));
        assertTrue("sendSync failed for exchange " + exchange.getId(), client.sendSync(exchange));
        assertEquals("bad status for exchange " + exchange.getId(), Status.Active, exchange.getStatus());
        exchange.setStatus(Status.Done);
        client.send(exchange);
        client.close();
        receiver.assertExchangesReceived(2, TIMEOUT);
    }

    public void testInOutJmsTxRbInError() throws Exception {
View Full Code Here

        exchange.getIn().setBody(new StringSource("<hello/>"));
        exchange.setTarget(nmr1.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME, PROXY_ENDPOINT_NAME)));
        assertTrue("sendSync failed for exchange " + exchange.getId(), client.sendSync(exchange));
        assertEquals("bad status for exchange " + exchange.getId(), Status.Active, exchange.getStatus());
        exchange.setStatus(Status.Done);
        client.send(exchange);
        client.close();
        receiver.assertExchangesReceived(3, TIMEOUT);
    }

    public void testInOutAckTxNoRb() throws Exception {
View Full Code Here

                    e.getIn().setBody("Hello");
                    client.sendSync(e);
                    logger.info("Response from Endpoint {}", e.getOut().getBody());
                    // Send back the Done status
                    e.setStatus(Status.Done);
                    client.send(e);
                } catch (Exception e) {
                    e.printStackTrace();
                    logger.error(e.getMessage());
                }
                // Sleep a bit
View Full Code Here

                    e.getIn().setBody("Hello");
                    client.sendSync(e);
                    LOG.info("Response from Endpoint " + e.getOut().getBody());
                    // Send back the Done status
                    e.setStatus(Status.Done);
                    client.send(e);
                } catch (Exception e) {
                    e.printStackTrace();
                    LOG.error(e.getMessage());
                }
                // Sleep a bit
View Full Code Here

       
       
        org.apache.servicemix.nmr.api.Exchange messageExchange = control.createMock(org.apache.servicemix.nmr.api.Exchange.class);
        EasyMock.expect(messageExchange.getOut()).andReturn(normalizedMessage).times(2);
        message.put(org.apache.servicemix.nmr.api.Exchange.class, messageExchange);
        channel.send(messageExchange);
        EasyMock.replay(channel);
       
        NMRDestinationOutputStream jbiOS = new NMRDestinationOutputStream(message, new MessageImpl(), channel);
       
        //Create array of more than what is in threshold in CachedOutputStream,
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.