Package org.apache.camel.component.mock

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


        mock.reset();
        mock.expectedBodiesReceived("");
        template.sendBody("direct:c", "");
        assertMockEndpointsSatisfied();

        mock.reset();
        mock.expectedMessageCount(1);
        mock.message(0).body().isNull();
        template.sendBody("direct:c", null);
        assertMockEndpointsSatisfied();
    }
View Full Code Here


        template.sendBodyAndHeader("direct:start", "Camel rocks", "messageId", "A");
        template.sendBodyAndHeader("direct:start", "Bar", "messageId", "B");

        assertMockEndpointsSatisfied();

        mock.reset();
        mock.expectedBodiesReceived("Camel rocks");

        repo.remove("A");

        template.sendBodyAndHeader("direct:start", "Camel rocks", "messageId", "A");
View Full Code Here

        template.sendBodyAndHeader("file:target/noop/bar", "b2", Exchange.FILE_NAME, "b.txt");

        assertMockEndpointsSatisfied();

        // reset mock and send in a new file to be picked up only
        mock.reset();
        mock.expectedBodiesReceived("c2");

        template.sendBodyAndHeader("file:target/noop", "c2", Exchange.FILE_NAME, "c.txt");

        assertMockEndpointsSatisfied();
View Full Code Here

        // the route is suspended by the policy so we should only receive one
        File file = new File("target/suspended/hello.txt").getAbsoluteFile();
        assertEquals("The file should exists", true, file.exists());

        // reset mock
        mock.reset();
        mock.expectedBodiesReceived("Hello World");

        // now resume it
        myPolicy.resumeConsumer();
View Full Code Here

        assertMockEndpointsSatisfied();

        Thread.sleep(1000);

        // reset mock and set new expectations
        mock.reset();
        mock.expectedMessageCount(0);

        // move file back
        File file = new File("target/idempotent/done/report.txt");
        File renamed = new File("target/idempotent/report.txt");
View Full Code Here

        mock.setResultWaitTime(3000);
        mock.expectedPropertyReceived(Exchange.BATCH_SIZE, 2);

        assertMockEndpointsSatisfied();

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

        assertMockEndpointsSatisfied();
    }
View Full Code Here

        template.sendBody("seda:foo", "Hello World");

        assertMockEndpointsSatisfied();

        mock.reset();
        mock.expectedBodiesReceived("stop");

        // we send stop command so we should only get 1 message
        template.sendBody("seda:foo", "stop");
View Full Code Here

        // let it run a little
        Thread.sleep(3000);

        assertMockEndpointsSatisfied();

        mock.reset();
        mock.expectedMessageCount(1);

        // resume the server so we can connect
        ftpServer.resume();
View Full Code Here

        return jndi;
    }

    public void testSplitBodyWithPojoBean() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.reset();
        mock.expectedBodiesReceived("James", "Jonathan", "Hadrian", "Claus", "Willem");

        template.sendBody("direct:body", "James,Jonathan,Hadrian,Claus,Willem");

        assertMockEndpointsSatisfied();
View Full Code Here

    }
   
    public void testSplitMessageWithPojoBean() throws Exception {
        String users[] = {"James", "Jonathan", "Hadrian", "Claus", "Willem"};
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.reset();
        mock.expectedMessageCount(5);
        template.sendBodyAndHeader("direct:message", "Test Body Message", "user", "James,Jonathan,Hadrian,Claus,Willem");
        int i = 0;
        for (Exchange exchange : mock.getExchanges()) {
            assertEquals("We got a wrong body ", "Test Body Message", exchange.getIn().getBody());
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.