Examples of expectedBodiesReceived()


Examples of org.apache.camel.component.mock.MockEndpoint.expectedBodiesReceived()

    protected int messageCount = 100;

    public void testSendingLotsOfMessagesGetAggregatedToTheLatestMessage() throws Exception {
        MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);

        resultEndpoint.expectedBodiesReceived("message:" + messageCount);

        // lets send a large batch of messages
        for (int i = 1; i <= messageCount; i++) {
            String body = "message:" + i;
            template.sendBodyAndHeader("direct:a", body, "cheese", 123);
View Full Code Here

Examples of org.apache.camel.component.mock.MockEndpoint.expectedBodiesReceived()

    protected Object expectedBody = "Hello there!";
    protected String uri = "file:target/test-default-inbox";

    public void testFileRoute() throws Exception {
        MockEndpoint result = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
        result.expectedBodiesReceived(expectedBody);
        result.setDefaulResultWaitMillis(5000);

        template.sendBodyAndHeader(uri, expectedBody, "cheese", 123);

        result.assertIsSatisfied();
View Full Code Here

Examples of org.apache.camel.component.mock.MockEndpoint.expectedBodiesReceived()

    private CamelTemplate template = new CamelTemplate(context1);
    private Object expectedBody = "<hello>world!</hello>";

    public void testSedaQueue() throws Exception {
        MockEndpoint result = context2.getEndpoint("mock:result", MockEndpoint.class);
        result.expectedBodiesReceived(expectedBody);

        template.sendBody("vm:test.a", expectedBody);

        result.assertIsSatisfied();
    }
View Full Code Here

Examples of org.apache.camel.component.mock.MockEndpoint.expectedBodiesReceived()

*/
public class XsltTest extends ContextTestSupport {

    public void testXslt() throws Exception {
        MockEndpoint resultEndpoint = (MockEndpoint)resolveMandatoryEndpoint("mock:result");
        resultEndpoint
            .expectedBodiesReceived("<?xml version=\"1.0\" encoding=\"UTF-8\"?><goodbye>world!</goodbye>");

        sendBody("direct:start", "<hello>world!</hello>");

        resultEndpoint.assertIsSatisfied();
View Full Code Here

Examples of org.apache.camel.component.mock.MockEndpoint.expectedBodiesReceived()

        return setupMock(payload);
    }

    private MockEndpoint setupMock(String payload) {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived(payload);
        return mock;
    }

    @Before
    public void setUp() throws Exception {
View Full Code Here

Examples of org.apache.camel.component.mock.MockEndpoint.expectedBodiesReceived()

        if (!ScriptTestHelper.canRunTestOnThisPlatform()) {
            return;
        }

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived(7, 9);

        sendBody("direct:start", 3);
        sendBody("direct:start", 4);

        assertMockEndpointsSatisfied();
View Full Code Here

Examples of org.apache.camel.component.mock.MockEndpoint.expectedBodiesReceived()

        if (!ScriptTestHelper.canRunTestOnThisPlatform()) {
            return;
        }

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived(7, 9);

        sendBody("direct:start", 3);
        sendBody("direct:start", 4);

        assertMockEndpointsSatisfied();
View Full Code Here

Examples of org.apache.camel.component.mock.MockEndpoint.expectedBodiesReceived()

        CamelContext camel = app.getBean("camelContext", CamelContext.class);

        MockEndpoint mock = camel.getEndpoint("mock:result", MockEndpoint.class);
        mock.expectedMessageCount(1);
        mock.expectedBodiesReceived("clustering PINGS!");

        // wait a bit to make sure the route has already been properly started through the given route policy
        Thread.sleep(5000);

        app.getBean("template", ProducerTemplate.class).sendBody("direct:start", "clustering");
View Full Code Here

Examples of org.apache.camel.component.mock.MockEndpoint.expectedBodiesReceived()

        CamelContext camel2 = app2.getBean("camelContext2", CamelContext.class);

        MockEndpoint mock2 = camel2.getEndpoint("mock:result", MockEndpoint.class);
        mock2.expectedMessageCount(1);
        mock2.expectedBodiesReceived("clustering PONGS!");

        app2.getBean("template", ProducerTemplate.class).sendBody("direct:start", "clustering");

        mock2.assertIsSatisfied();
View Full Code Here

Examples of org.apache.camel.component.mock.MockEndpoint.expectedBodiesReceived()

    private static final Logger LOG = LoggerFactory.getLogger(ToObservableBodyTest.class);

    @Test
    public void testConsume() throws Exception {
        final MockEndpoint mockEndpoint = camelContext.getEndpoint("mock:results", MockEndpoint.class);
        mockEndpoint.expectedBodiesReceived("b", "d");

        // lets consume, filter and map events
        Observable<Order> observable = reactiveCamel.toObservable("seda:orders", Order.class);
        Observable<String> largeOrderIds = observable.filter(new Func1<Order, Boolean>() {
            @Override
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.