|
Testing has been edited by James Strachan (Dec 03, 2008). Content:TestingTesting is a crucial activity in any piece of software development or integration. Typically Camel Riders use various different technologies wired together in a variety of patterns with different _expression_ languages together with different forms of Bean Integration and Dependency Injection so its very easy for things to go wrong! Camel is a Java library so you can easily wire up tests in whatever unit testing framework you use (JUnit 3.x, 4.x or TestNG). However the Camel project has tried to make the testing of Camel as easy and powerful as possible so we have introduced the following features. Testing mechanismsThe following mechanisms are supported
In all approaches the test classes look pretty much the same in that they all reuse the Camel binding and injection annotations. Here is the Camel Test Error formatting macro: snippet: java.lang.IllegalArgumentException: Invalid url: must begin with a configured prefix.
Testing endpointsCamel provides a number of endpoints which can make testing easier.
The main endpoint is the Mock endpoint which allows expectations to be added to different endpoints; you can then run your tests and assert that your expectations are met at the end. Stubbing out physical transport technologiesIf you wish to test out a route but want to avoid actually using a real physical transport (for example to unit test a transformation route rather than performing a full integration test) then the following endpoints can be useful.
|
Unsubscribe or edit your notifications preferences
