camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Jackson <>
Subject Integration testing a route before production
Date Sat, 06 Feb 2010 16:09:14 GMT

I have a route configured in Spring and I would like to integration
test (from file endpoint with production data to persistence in test

For example:

<camel:route id="integration-test">
  <camel:from ref="file-consumer"/>
  <camel:split streaming="true">
    <camel:tokenize token="\n"/>
    <camel:bean ref="Unmarshaller" method="unmarshall"/>
    <camel:bean ref="Transformer" method="transform"/>
    <camel:to uri="mock:result"/>

Now I want to run this route with production data and ensure that the
sample of data I used in my unit tests is representative and that the
production data doesn't cause my pojos to break in any weird ways.
I'm also interested in seeing how much ram this single route will
consume with realistic data before I add it to the live routes.

# How do I trigger this route to run (in the context of an @Test
decorated method)?
# How do I make any meaningful assertions against the mock:result?

Essentially I want to 'assertNoExceptions' and assertTrue(memoryUsed <
80Mb) (or any other arbitrary value.  If I wire up the db layer I can
assert against the data in the tables, but that's a data centric
approach and I think what I'm after is not easily defined by data.

For example I can prove by induction that if the code works for 1
valid input dataset then it will work for n valid input datasets, so
I'm leaning more towards testing intangibles (performance
[time|space], robustness of handling real workloads/data etc).

Sorry I can't really explain why I feel I need to do this, just that I
think it's necessary in this one particular case - does anyone have
any suggestions for how to at least start up the route in a testing


View raw message