Package org.apache.camel.component.mock

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


    @Test
    public void testAsyncJmsInOut() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(100);
        mock.expectsNoDuplicates(body());

        StopWatch watch = new StopWatch();

        for (int i = 0; i < 100; i++) {
            template.sendBody("seda:start", "" + i);
View Full Code Here


    public void testSplitWithCustomAggregatorStrategy() throws Exception {
        int files = 10;
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(files);
        // no duplicates should be received
        mock.expectsNoDuplicates(body());

        for (int i = 0; i < files; i++) {
            template.sendBody("direct:start", "");
        }
View Full Code Here

    }

    public void testSendingAMessageUsingMulticastReceivesItsOwnExchangeParallel() throws Exception {
        MockEndpoint resultEndpoint = getMockEndpoint("mock:result");

        resultEndpoint.expectsNoDuplicates(body());
        resultEndpoint.expectedMessageCount(4);

        // InOnly
        template.send("direct:parallel", new Processor() {
            public void process(Exchange exchange) {
View Full Code Here

    @Test
    public void testConnectionResourceRouter() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(100);
        mock.expectsNoDuplicates(body());

        StopWatch watch = new StopWatch();

        for (int i = 0; i < 100; i++) {
            template.sendBody("seda:start", "" + i);
View Full Code Here

    private void doSendMessages(int files, int poolSize) throws Exception {
        resetMocks();
        MockEndpoint mockEndpoint = getMockEndpoint("mock:result");
        mockEndpoint.expectedMessageCount(files);
        mockEndpoint.expectsNoDuplicates(body());

        ExecutorService executor = Executors.newFixedThreadPool(poolSize);
        for (int i = 0; i < files; i++) {
            final int index = i;
            executor.submit(new Callable<Object>() {
View Full Code Here

    }

    public void testSendingAMessageUsingMulticastReceivesItsOwnExchangeParallel() throws Exception {
        MockEndpoint resultEndpoint = getMockEndpoint("mock:result");

        resultEndpoint.expectsNoDuplicates(body());
        resultEndpoint.expectedMessageCount(4);

        // InOnly
        template.send("direct:parallel", new Processor() {
            public void process(Exchange exchange) {
View Full Code Here

    public void testSplitWithCustomAggregatorStrategy() throws Exception {
        int files = 10;
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(files);
        // no duplicates should be received
        mock.expectsNoDuplicates(body());

        for (int i = 0; i < files; i++) {
            template.sendBody("direct:start", "");
        }
View Full Code Here

                }
            });
        }

        mock.assertIsSatisfied();
        mock.expectsNoDuplicates(body());
    }

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            public void configure() throws Exception {
View Full Code Here

        template.sendBodyAndHeader("file:target/concurrent", sb.toString(), Exchange.FILE_NAME, "input.txt");

        // start route
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(size);
        mock.expectsNoDuplicates(body());
        mock.setResultWaitTime(30000);

        context.startRoute("foo");

        assertMockEndpointsSatisfied();
View Full Code Here

                }
            });
        }

        mock.assertIsSatisfied();
        mock.expectsNoDuplicates(body());
    }

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            public void configure() 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.