Examples of matchesMockWaitTime()


Examples of org.apache.camel.builder.NotifyBuilder.matchesMockWaitTime()

        template.sendBodyAndHeader("activemq:queue:inbox", "A", "uid", 123);

        // assert mock and wait for the message to be done
        assertMockEndpointsSatisfied();
        assertTrue("Should complete 1 message", notify.matchesMockWaitTime());

        // check that there is a message in the database and JMS queue
        assertEquals(1, jdbcTemplate.queryForInt("select count(*) from  CAMEL_MESSAGEPROCESSED"));
        Object out = consumer.receiveBody("activemq:queue:outbox", 3000);
        assertEquals("DONE-A", out);
View Full Code Here

Examples of org.apache.camel.builder.NotifyBuilder.matchesMockWaitTime()

        template.sendBodyAndHeader("activemq:queue:inbox", "A", "uid", 123);

        // assert mock and wait for the message to be done
        assertMockEndpointsSatisfied();
        assertTrue("Should complete 7 message", notify.matchesMockWaitTime());

        // check that there is a message in the database and JMS queue
        assertEquals(0, jdbcTemplate.queryForInt("select count(*) from  CAMEL_MESSAGEPROCESSED"));
        assertNull(consumer.receiveBody("activemq:queue:outbox", 3000));

View Full Code Here

Examples of org.apache.camel.builder.NotifyBuilder.matchesMockWaitTime()

        template.sendBodyAndHeader("activemq:queue:inbox", "B", "uid", 456);

        // assert mock and wait for the message to be done
        assertMockEndpointsSatisfied();
        assertTrue("Should complete 7 messages", notify.matchesMockWaitTime());

        // check that there is a message in the database and JMS queue
        assertEquals(0, jdbcTemplate.queryForInt("select count(*) from  CAMEL_MESSAGEPROCESSED"));
        assertNull(consumer.receiveBody("activemq:queue:outbox", 3000));

View Full Code Here

Examples of org.apache.camel.builder.NotifyBuilder.matchesMockWaitTime()

        template.sendBodyAndHeader("activemq:queue:inbox", "E", "uid", 222);
        template.sendBodyAndHeader("activemq:queue:inbox", "D", "uid", 111);

        // assert mock and wait for the message to be done
        assertMockEndpointsSatisfied();
        assertTrue("Should complete 3 messages", notify.matchesMockWaitTime());

        // check that there is two messages in the database and JMS queue
        assertEquals(2, jdbcTemplate.queryForInt("select count(*) from  CAMEL_MESSAGEPROCESSED"));
        assertEquals("DONE-D", consumer.receiveBody("activemq:queue:outbox", 3000));
        assertEquals("DONE-E", consumer.receiveBody("activemq:queue:outbox", 3000));
View Full Code Here

Examples of org.apache.camel.builder.NotifyBuilder.matchesMockWaitTime()

        template.sendBodyAndHeader("activemq:queue:inbox", "E", "uid", 222);
        template.sendBodyAndHeader("activemq:queue:inbox", "F", "uid", 333);

        // assert mock and wait for the message to be done
        assertMockEndpointsSatisfied();
        assertTrue("Should complete 4 messages", notify.matchesMockWaitTime());

        // check that there is two messages in the database and JMS queue
        assertEquals(3, jdbcTemplate.queryForInt("select count(*) from  CAMEL_MESSAGEPROCESSED"));
        assertEquals("DONE-D", consumer.receiveBody("activemq:queue:outbox", 3000));
        assertEquals("DONE-E", consumer.receiveBody("activemq:queue:outbox", 3000));
View Full Code Here

Examples of org.apache.camel.builder.NotifyBuilder.matchesMockWaitTime()

        // should be 1 completed and 1 failed
        NotifyBuilder notify = new NotifyBuilder(context).whenDone(2).create();

        template.sendBody("activemq:queue:foo", "blah");

        notify.matchesMockWaitTime();

        assertTrue("Expected only 2 calls to process() (1 failure, 1 success) but encountered "
                   + getConditionalExceptionProcessor().getCount() + "."
                   , getConditionalExceptionProcessor().getCount() == 2);
    }
View Full Code Here

Examples of org.apache.camel.builder.NotifyBuilder.matchesMockWaitTime()

        getMockEndpoint("mock:result").expectedBodiesReceived(body);
        // 2 first attempt should fail
        getMockEndpoint("mock:error").expectedMessageCount(2);

        assertMockEndpointsSatisfied();
        notify.matchesMockWaitTime();

        assertEquals(3, counter);

        // assert the file is deleted
        File file = new File("./target/deletefile/hello.txt");
View Full Code Here

Examples of org.apache.camel.builder.NotifyBuilder.matchesMockWaitTime()

    public void testFileToFtp() throws Exception {
        NotifyBuilder notify = new NotifyBuilder(context).whenDone(1).create();

        template.sendBodyAndHeader("file:target/in", "Hello World", Exchange.FILE_NAME, "sub/hello.txt");

        assertTrue(notify.matchesMockWaitTime());

        File file = new File(FTP_ROOT_DIR + "out/sub/hello.txt");
        assertTrue("File should exists " + file, file.exists());
    }
View Full Code Here

Examples of org.apache.camel.builder.NotifyBuilder.matchesMockWaitTime()

        // should be 1 completed and 1 failed
        NotifyBuilder notify = new NotifyBuilder(context).whenDone(2).create();

        template.sendBody("activemq:queue:foo", "blah");

        notify.matchesMockWaitTime();

        assertTrue("Expected only 2 calls to process() (1 failure, 1 success) but encountered "
                   + getConditionalExceptionProcessor().getCount() + "."
                   , getConditionalExceptionProcessor().getCount() == 2);
    }
View Full Code Here

Examples of org.apache.camel.builder.NotifyBuilder.matchesMockWaitTime()

        for (int i = 0; i < 10; ++i) {
            template.sendBodyAndHeader("file://target/file-batch1/", "CIAO", "CamelFileName", "CIAO" + i);
        }

        Assert.assertTrue("Timeout waiting for match" + nb.toString(), nb.matchesMockWaitTime());
        context.stop();

        InputStream in = null;
        try {
            in = new URL("file:///" + file.toUri()).openStream();
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.