Package org.apache.camel.component.mock

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


        assertEquals(1, context.getRoutes().size());
        MockEndpoint mock = getMockEndpoint("mock:definitelyShouldNeverReceiveExchange");
        mock.expectedMessageCount(0);

        sendBody("direct:shouldNeverRecieveExchange", "dropped like a hot rock");
        mock.await(500, TimeUnit.MILLISECONDS);
        mock.assertIsSatisfied();
    }

    public void testSpringComponentScanFeature() throws InterruptedException {
        template.sendBody("direct:start", "request");
View Full Code Here


            frame.addHeader(MESSAGE_ID, StompFrame.encodeHeader("msg:" + i));
            frame.content(utf8("Important Message " + i));
            producerConnection.send(frame);
        }

        mock.await(5, TimeUnit.SECONDS);
        mock.assertIsSatisfied();
    }

    protected RouteBuilder createRouteBuilder() {
        return new RouteBuilder() {
View Full Code Here

            frame.addHeader(MESSAGE_ID, StompFrame.encodeHeader("msg:" + i));
            frame.content(utf8("Important Message " + i));
            producerConnection.send(frame);
        }

        mock.await(5, TimeUnit.SECONDS);
        mock.assertIsSatisfied();
    }

    protected RouteBuilder createRouteBuilder() {
        return new RouteBuilder() {
View Full Code Here

    public void canSupplySingleCodecToEndpointPipeline() throws Exception {
        String poem = new Poetry().getPoem();
        MockEndpoint mock = getMockEndpoint("mock:single-codec");
        mock.expectedBodiesReceived(poem);
        sendBody("direct:single-codec", poem);
        mock.await(1, TimeUnit.SECONDS);
        mock.assertIsSatisfied();

    }

    protected RouteBuilder createRouteBuilder() throws Exception {
View Full Code Here

    public void testDisruptorNoTimeout() throws Exception {
        final MockEndpoint result = getMockEndpoint("mock:result");
        result.setExpectedMessageCount(1);
        final Future<String> out = template.asyncRequestBody("disruptor:foo", "World", String.class);
        assertEquals("Bye World", out.get());
        result.await(1, TimeUnit.SECONDS);
        assertMockEndpointsSatisfied();
    }

    @Test
    public void testDisruptorTimeout() throws Exception {
View Full Code Here

            final DisruptorEndpoint de = (DisruptorEndpoint)context.getRoute("disruptor").getEndpoint();
            assertNotNull("Consumer endpoint cannot be null", de);
            //we can't remove the exchange from a Disruptor once it is published, but it should never reach the
            //mock:result endpoint because it should be filtered out by the DisruptorConsumer
            result.await(1, TimeUnit.SECONDS);
            assertMockEndpointsSatisfied();
        }
    }

    @Test
View Full Code Here

    public void canSupplyMultipleCodecsToEndpointPipeline() throws Exception {
        String poem = new Poetry().getPoem();
        MockEndpoint mock = getMockEndpoint("mock:multiple-codec");
        mock.expectedBodiesReceived(poem);
        sendBody("direct:multiple-codec", poem);
        mock.await(1, TimeUnit.SECONDS);
        mock.assertIsSatisfied();

    }

    protected RouteBuilder createRouteBuilder() throws Exception {
View Full Code Here

    public void canSupplyMultipleCodecsToEndpointPipeline() throws Exception {
        String poem = new Poetry().getPoem();
        MockEndpoint mock = getMockEndpoint("mock:multiple-codec");
        mock.expectedBodiesReceived(poem);
        sendBody("direct:multiple-codec", poem);
        mock.await(1, TimeUnit.SECONDS);
        mock.assertIsSatisfied();
    }
}
View Full Code Here

        template.sendBodyAndHeader("direct:start", "A", "id", 123);
        template.sendBodyAndHeader("direct:start", "B", "id", 123);
        template.sendBodyAndHeader("direct:start", "C", "id", 123);

        // should complete before timeout
        mock.await(1500, TimeUnit.MILLISECONDS);
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
View Full Code Here

        mock.expectedMinimumMessageCount(10);

        createCamelNode();
        updateNode(10);

        mock.await(5, TimeUnit.SECONDS);
        mock.assertIsSatisfied();

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