Package org.apache.camel.component.mock

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


    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


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

        // wait 20 seconds to give more time for slow servers
        bar.await(20, TimeUnit.SECONDS);

        int batch = bar.getReceivedExchanges().get(0).getProperty(Exchange.BATCH_SIZE, int.class);

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

        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

        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 testRoutesNotExcludedWorkNormally() throws InterruptedException {
        template.sendBody("direct:start", "request");
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

        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

        for (int i = 0; i < numberOfMessages; i++) {
            String payload = "Message " + i;
            publisherConnection.publish(topic.name().toString(), payload.getBytes(), QoS.AT_LEAST_ONCE, false);
        }

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


    protected RouteBuilder createRouteBuilder() {
View Full Code Here

        updateNode(10);

        delay(200);
        client.delete("/camel");

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

        int lastVersion = -1;
        for (int i = 0; i < mock.getExchanges().size(); i++) {
            assertEquals(expectedEventTypes[i], mock.getExchanges().get(i).getIn().getHeader(ZooKeeperMessage.ZOOKEEPER_EVENT_TYPE));
View Full Code Here

        // recreate and update a number of times.
        createCamelNode();
        updateNode(10);
 
        mock.await(5, TimeUnit.SECONDS);
        mock.assertIsSatisfied();
       
        client.delete("/camel");
    }
View Full Code Here

        client.create("/grimm/hansel", "child");
        client.create("/grimm/gretel", "child");
        client.delete("/grimm/hansel");
        client.delete("/grimm/gretel");

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

        validateExchangesContainListings(mock, createChildListing(), createChildListing("hansel"), createChildListing("hansel", "gretel"), createChildListing("gretel"),
                                         createChildListing());
    }
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.