Examples of expectsNoDuplicates()


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

public class BeanConcurrentTest extends ContextTestSupport {

    public void testBeanConcurrent() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(1000);
        mock.expectsNoDuplicates(body());

        // start from 1000 to be 4 digit always (easier to string compare)
        for (int i = 1000; i < 2000; i++) {
            template.sendBody("seda:foo", "" + i);
        }
View Full Code Here

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

public class AggregateMultipleSourceTest extends ContextTestSupport {

    public void testAggregateMultipleSourceTest() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(2);
        mock.expectsNoDuplicates(body());
        mock.setResultWaitTime(20000);

        for (int i = 0; i < 40; i++) {
            if (i % 2 == 0) {
                template.sendBodyAndHeader("seda:foo", "" + i, "type", "A");
View Full Code Here

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

    }

    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

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

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

    public void testConcurrencyParallelMulticast() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(20);
        // this time we cannot expect in order but there should be no duplicates
        mock.expectsNoDuplicates(header("id"));

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

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

        final ProducerTemplate producer = (ProducerTemplate) context.getBean("camelTemplate");

        final MockEndpoint mock = (MockEndpoint) context.getBean("result");
        mock.expectedMessageCount(SIZE);
        // expect no duplicate bodies
        mock.expectsNoDuplicates().body();
        // and all replies should start with this text
        mock.allMessages().body().startsWith("Bye Message");

        // now send a lot of messages
        System.out.println("Sending ...");
View Full Code Here

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

        final ProducerTemplate producer = (ProducerTemplate) context.getBean("camelTemplate");

        final MockEndpoint mock = (MockEndpoint) context.getBean("result");
        mock.expectedMessageCount(SIZE);
        // expect no duplicate bodies
        mock.expectsNoDuplicates().body();

        // now send a lot of messages
        System.out.println("Sending ...");
        for (int i = 0; i < SIZE; i++) {
            InputReportIncident input = new InputReportIncident();
View Full Code Here

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

    }

    public void testXPathSplitStream() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:splitted");
        mock.expectedMessageCount(size);
        mock.expectsNoDuplicates().body();

        assertMockEndpointsSatisfied();
    }

    @Override
View Full Code Here

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

    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

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

    }

    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
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.