Package org.apache.camel.component.mock

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


        ctx.start();

        String addressLine1 = "8506 SIX FORKS ROAD, , ,,, ,";

        MockEndpoint mock = ctx.getEndpoint("mock:result", MockEndpoint.class);
        mock.expectedPropertyReceived("addressLine1", addressLine1);

        String csvLine = "\"PROBLEM SOLVER\",\"" + addressLine1
                         + "\",\"SUITE 104\",\"RALEIGH\",\"NC\",\"27615\",\"US\"";
        ProducerTemplate template = ctx.createProducerTemplate();
        template.sendBody("direct:fromCsv", csvLine.trim());
View Full Code Here


        // TODO The separator in the beginning of the quoted field is still not handled.
        // We may need to convert the separators in the quote into some kind of safe code
        String addressLine1 = ",8506 SIX FORKS ROAD,";

        MockEndpoint mock = ctx.getEndpoint("mock:result", MockEndpoint.class);
        mock.expectedPropertyReceived("addressLine1", addressLine1);

        String csvLine = "\"PROBLEM SOLVER\",\"" + addressLine1
                         + "\",\"SUITE 104\",\"RALEIGH\",\"NC\",\"27615\",\"US\"";
        ProducerTemplate template = ctx.createProducerTemplate();
        template.sendBody("direct:fromCsv", csvLine.trim());
View Full Code Here

    }

    public void testAggregateProcessorTimeoutRestart() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("A+B");
        mock.expectedPropertyReceived(Exchange.AGGREGATED_COMPLETED_BY, "timeout");

        Processor done = new SendProcessor(context.getEndpoint("mock:result"));
        Expression corr = header("id");
        AggregationStrategy as = new BodyInAggregatingStrategy();
View Full Code Here

    }

    public void testAggregateProcessorTimeoutExpressionRestart() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("A+B");
        mock.expectedPropertyReceived(Exchange.AGGREGATED_COMPLETED_BY, "timeout");

        Processor done = new SendProcessor(context.getEndpoint("mock:result"));
        Expression corr = header("id");
        AggregationStrategy as = new BodyInAggregatingStrategy();
View Full Code Here

    }

    public void testAggregateProcessorTwoTimeoutExpressionRestart() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("C+D", "A+B");
        mock.expectedPropertyReceived(Exchange.AGGREGATED_COMPLETED_BY, "timeout");

        Processor done = new SendProcessor(context.getEndpoint("mock:result"));
        Expression corr = header("id");
        AggregationStrategy as = new BodyInAggregatingStrategy();
View Full Code Here

        mock.message(1).property(Exchange.BATCH_COMPLETE).isEqualTo(false);
        mock.message(2).property(Exchange.BATCH_COMPLETE).isEqualTo(false);
        mock.message(3).property(Exchange.BATCH_COMPLETE).isEqualTo(false);
        mock.message(3).property(Exchange.BATCH_COMPLETE).isEqualTo(false);
        mock.message(4).property(Exchange.BATCH_COMPLETE).isEqualTo(true);
        mock.expectedPropertyReceived(Exchange.BATCH_SIZE, 5);

        assertMockEndpointsSatisfied();
    }

    private void prepareMailbox() throws Exception {
View Full Code Here

        mock.setResultWaitTime(2000);
        mock.expectedMessageCount(3);
        mock.message(0).body().isEqualTo("Message 0");
        mock.message(1).body().isEqualTo("Message 1");
        mock.message(2).body().isEqualTo("Message 2");
        mock.expectedPropertyReceived(Exchange.BATCH_SIZE, 3);

        assertMockEndpointsSatisfied();

        mock.reset();
        mock.expectedMessageCount(2);
View Full Code Here

        assertMockEndpointsSatisfied();

        mock.reset();
        mock.expectedMessageCount(2);
        mock.expectedPropertyReceived(Exchange.BATCH_SIZE, 2);
        mock.message(0).body().isEqualTo("Message 3");
        mock.message(1).body().isEqualTo("Message 4");

        assertMockEndpointsSatisfied();
    }
View Full Code Here

        context.startRoute("foo");

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("AAA", "BBB");
        mock.setResultWaitTime(4000);
        mock.expectedPropertyReceived(Exchange.BATCH_SIZE, 2);

        assertMockEndpointsSatisfied();

        mock.reset();
        mock.expectedBodiesReceived("CCC");
View Full Code Here

        assertMockEndpointsSatisfied();

        mock.reset();
        mock.expectedBodiesReceived("CCC");
        mock.expectedPropertyReceived(Exchange.BATCH_SIZE, 1);

        assertMockEndpointsSatisfied();
    }
   
    private void prepareFtpServer() throws Exception {
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.