Examples of expectedMessageCount()


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

    }

    @Test
    public void testSendA01() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:a01");
        mock.expectedMessageCount(1);
        mock.message(0).body().isInstanceOf(Message.class);

        String line1 = "MSH|^~\\&|MYSENDER|MYSENDERAPP|MYCLIENT|MYCLIENTAPP|200612211200||ADT^A01|123|P|2.4";
        String line2 = "PID|||123456||Doe^John";
View Full Code Here

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

    }

    @Test
    public void testSendUnknown() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:unknown");
        mock.expectedMessageCount(1);
        mock.message(0).body().isInstanceOf(Message.class);

        String line1 = "MSH|^~\\&|MYSENDER|MYSENDERAPP|MYCLIENT|MYCLIENTAPP|200612211200||ADT^A02|1234|P|2.4";
        String line2 = "PID|||123456||Doe^John";
View Full Code Here

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

    private Condition cond1 = lock.newCondition();
   
    @Test
    public void testRouteJpa() throws Exception {
        MockEndpoint mock1 = getMockEndpoint("mock:result1");
        mock1.expectedMessageCount(2);
        MockEndpoint mock2 = getMockEndpoint("mock:result2");
        mock2.expectedMessageCount(2);

        template.sendBody("jpa://" + VersionedItem.class.getName(), new VersionedItem("one"));
        template.sendBody("jpa://" + VersionedItem.class.getName(), new VersionedItem("two"));
View Full Code Here

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

    @Test
    public void testRouteJpa() throws Exception {
        MockEndpoint mock1 = getMockEndpoint("mock:result1");
        mock1.expectedMessageCount(2);
        MockEndpoint mock2 = getMockEndpoint("mock:result2");
        mock2.expectedMessageCount(2);

        template.sendBody("jpa://" + VersionedItem.class.getName(), new VersionedItem("one"));
        template.sendBody("jpa://" + VersionedItem.class.getName(), new VersionedItem("two"));
        template.sendBody("jpa://" + VersionedItem.class.getName(), new VersionedItem("three"));
        template.sendBody("jpa://" + VersionedItem.class.getName(), new VersionedItem("four"));
View Full Code Here

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

    }


    private void runChmodCheck(String routeSuffix, String expectedPermissions) throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:chmod" + routeSuffix);
        mock.expectedMessageCount(1);
        String testFileName = "chmod" + routeSuffix + ".txt";
        String fullTestFileName = TEST_DIRECTORY + testFileName;
        String testFileContent = "Writing file with chmod " + routeSuffix + " option at " + new Date();
        mock.expectedFileExists(fullTestFileName, testFileContent);
View Full Code Here

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

     * Write a file without chmod set, should work normally and not throw an exception for invalid chmod value
     * @throws Exception
     */
    public void testWriteNoChmod() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:noChmod");
        mock.expectedMessageCount(1);
        String testFileName = "noChmod.txt";
        String fullTestFileName = TEST_DIRECTORY + testFileName;
        String testFileContent = "Writing file with no chmod option at " + new Date();
        mock.expectedFileExists(fullTestFileName, testFileContent);
        template.sendBodyAndHeader("direct:writeNoChmod", testFileContent, Exchange.FILE_NAME, testFileName);
View Full Code Here

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

    @Test
    public void emptyAtStartupTest() throws Exception {
        MockEndpoint mockResultEndpoint = getMockEndpoint("mock:result");
       
        mockResultEndpoint.expectedMessageCount(0);

        mockResultEndpoint.assertIsSatisfied();
    }

View Full Code Here

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

   
    @Test
    public void emptyAtStartupTest() throws Exception {
        MockEndpoint mockResultEndpoint = getMockEndpoint("mock:result");

        mockResultEndpoint.expectedMessageCount(0);
       
        mockResultEndpoint.assertIsSatisfied();
    }

View Full Code Here

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

    @Test
    public void shouldResolveBothCamelAndSpringPlaceholders() throws InterruptedException {
        // Given
        MockEndpoint mockEndpoint = camelContext.getEndpoint("mock:test", MockEndpoint.class);
        mockEndpoint.expectedMessageCount(1);

        // When
        producerTemplate.sendBody(from, "msg");

        // Then
View Full Code Here

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

        MessageConsumer mc = createQueueConsumer(TEST_DESTINATION_NAME);
        assertNotNull(mc);
        final String expectedBody = "Hello World!";
        MockEndpoint mock = getMockEndpoint("mock:result");

        mock.expectedMessageCount(1);
        mock.expectedBodiesReceived(expectedBody);

        template.sendBody("direct:start", expectedBody);
        Message message = mc.receive(5000);
        assertNotNull(message);
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.