You can also externalize the endpoint configuration (the string) and use the
properties placeholder configurer. Than you can use different configurations
for different environments (dev, test, prod).

Sent from a mobile device
Am 10.08.2011 12:28 schrieb "jason.parr" <[email protected]>:
> Hi,
>
> I want to test my 'production' route unchanged using CamelTestSupport.
>
> As show in the doco I stub out jms component with an inprocess trasnport
say
> seda:
>
> @Override
> protected CamelContext createCamelContext() throws Exception {
> CamelContext context = super.createCamelContext();
> context.addComponent("jms", context.getComponent("seda"));
> ...
>
> This works fine until any of my jms endpoints in the 'production' route
have
> jms specific parameter, e.g.
>
> from("direct:tradebus-trades")
> .to("jms:topic:NOMURA.FIET.STP.RADIAL.TRADES?&disableReplyTo=true");
>
> When I run my test I now get:
>
> org.apache.camel.FailedToCreateRouteException: ... There are 1 parameters
> that couldn't be set on the endpoint. Check the uri if the parameters are
> spelt correctly and that they are properties of the endpoint. Unknown
> parameters=[{disableReplyTo=true}]
>
> What's the best way of replacing jms with an inprocess transport without
> having to change the original route?
>
> In my test I add an extra a file endpoint to play messages into the
original
> route, which seems to work fine.
>
> @Override
> protected RouteBuilder createRouteBuilder() throws Exception {
> return new RadialRouteBuilder() {
> @Override
> public void configure() {
> super.configure();
>
>
>
from("file:src/test/data/radial-route-builder-test-case?noop=true&include=bond_msg.*")
> .to("jms:queue:nomura.fiet.stp.bloomberg.bond-trades");
>
> Thanks
>
> --
> View this message in context:
http://camel.465427.n5.nabble.com/Stubbing-jms-with-an-inprocess-transport-when-using-CamelTestSupport-tp4685084p4685084.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to