Wednesday, January 18, 2012

Unit testing Camel Blueprint routes

Last week, while in Vegas, I discussed with my colleague Scott Cranton and he told me that something that was really making our users tend to stick with Spring-DM when using Camel Blueprint routes was that unit testing those routes was not possible.

So I hacked a small support library for Camel, leveraging PojoSR which provides a service registry without using a fully compliant OSGi container. This allows defining real unit tests (as opposed to integration tests using Pax Exam.

See the below example.

public class DebugBlueprintTest extends CamelBlueprintTestSupport {

    protected Collection<URL> getBlueprintDescriptors() {
        return Collections.singleton(getClass().getResource("camelContext.xml"));

    public void testRoute() throws Exception {
        // set mock expectations

        // send a message
        template.sendBody("direct:start", "World");

        // assert mocks

<blueprint xmlns="">

 <camelcontext autostartup="true" id="camelContext" trace="true" xmlns="">

   <from uri="direct:start"/>
    <simple>Hello ${body}</simple>
   <to uri="mock:a"/>


Tuesday, January 17, 2012

Back from Las Vegas

I'm back from Las Vegas where we had a fantastic FuseSource KickOff meeting.

As you can see below, a real camel had been brought from the west coast and James even had a short ride on it! On the technical side, we expect a bunch of exciting stuff this year, so you'll certainly hear from us soon.