On Wed, Dec 9, 2009 at 3:30 PM, jihedamine <[email protected]> wrote:
>
> Hi,
> I'm testing Normalizer pattern with Camel and I'll be using a POJO to
> normalize messages.
>
> My route builder is using bean:normalizer and its methods:
> �...@override
> protected RouteBuilder createRouteBuilder() {
> return new RouteBuilder() {
> public void configure() {
> from("direct:start")
> .choice()
>
> .when().xpath("/employee").to("bean:normalizer?method=employeeToPerson")
>
> .when().xpath("/customer").to("bean:normalizer?method=customerToPerson")
> .end()
> .to("mock:result");
> }
> };
> }
>
> Can I inject the normalizer bean in my CamelNormalizerTest class that
> extends CamelTestSupport using annotations and no xml files to define the
> context ?
>
Yeah however instead of using .to("bean:normalizer") you can use a
.bean(myBean, "customerToPerson")
Otherwise you need to register your bean in the registry as
to("bean:xxx") will lookp in the Registry for the bean.
> Thanks
> --
> View this message in context:
> http://old.nabble.com/Inject-a-bean-in-a-class-extending-CamelTestSupport-tp26711104p26711104.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
--
Claus Ibsen
Apache Camel Committer
Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus