Package org.apache.camel.component.mock

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


    }

    @Test
    public void testShutdownCompleteCurrentTaskOnly() throws Exception {
        MockEndpoint bar = getMockEndpoint("mock:bar");
        bar.expectedMinimumMessageCount(1);
        bar.setResultWaitTime(3000);

        assertMockEndpointsSatisfied();

        // shutdown during processing
View Full Code Here


    }

    @Test
    public void testShutdownAllTasks() throws Exception {
        MockEndpoint bar = getMockEndpoint("mock:bar");
        bar.expectedMinimumMessageCount(1);
        bar.setResultWaitTime(3000);

        assertMockEndpointsSatisfied();

        // shutdown during processing
View Full Code Here

        // give Jetty time to startup properly
        Thread.sleep(1000);

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMinimumMessageCount(1);
        mock.message(0).body().isInstanceOf(InputStream.class);
        mock.message(0).header("Content-Type").isEqualTo("image/jpeg");

        Exchange out = template.send("jetty://http://localhost:9080/myapp/myservice", new Processor() {
            public void process(Exchange exchange) throws Exception {
View Full Code Here

    protected JpaTemplate jpaTemplate;

    @Test
    public void testRouteJpa() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMinimumMessageCount(1);

        template.sendBody("direct:start", new SendEmail("one@somewhere.org"));
        template.sendBody("direct:start", new SendEmail("two@somewhere.org"));
        template.sendBody("direct:start", new SendEmail("three@somewhere.org"));
View Full Code Here

            }
        });
        context.start();

        MockEndpoint bar = getMockEndpoint("mock:bar");
        bar.expectedMinimumMessageCount(2);

        assertMockEndpointsSatisfied();

        // shutdown during processing
        context.stop();
View Full Code Here

    @Test
    public void testSendAndReceiveMails() throws Exception {
        Mailbox.clearAll();

        MockEndpoint resultEndpoint = getMockEndpoint("mock:result");
        resultEndpoint.expectedMinimumMessageCount(1);

        Properties properties = new Properties();
        properties.put("mail.smtp.host", "localhost");
        Session session = Session.getInstance(properties, null);
View Full Code Here

    @Test
    public void testFtpRecover() throws Exception {
        // should be able to download the file after recovering
        MockEndpoint resultEndpoint = getMockEndpoint("mock:result");
        resultEndpoint.expectedMinimumMessageCount(3);

        template.sendBody(getFtpUrl(), "Hello World");

        resultEndpoint.assertIsSatisfied();
View Full Code Here

    @Test
    public void testConsume() throws Exception {

        MockEndpoint endpoint = getMockEndpoint("mock:results");
        endpoint.expectedMinimumMessageCount(2);

        Account account = new Account();
        account.setId(1);
        account.setFirstName("Bob");
        account.setLastName("Denver");
View Full Code Here

        template.sendBody("jpa://" + SendEmail.class.getName(), new SendEmail("kaboom@beer.org"));

        // should rollback the entire
        MockEndpoint mock = getMockEndpoint("mock:result");
        // we should retry and try again
        mock.expectedMinimumMessageCount(4);

        // start route
        context.startRoute("foo");

        assertMockEndpointsSatisfied();
View Full Code Here

    @Test
    public void testQuartzCronRoute() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.setResultWaitTime(15000);
        mock.expectedMinimumMessageCount(3);
        mock.message(0).arrives().between(7, 9).seconds().beforeNext();
        mock.message(2).arrives().between(3, 5).seconds().afterPrevious();

        assertMockEndpointsSatisfied();
    }
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.