camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tadayoshi Sato <sato.tadayo...@gmail.com>
Subject Re: Unit test case for XML DSL context and routes
Date Wed, 06 Jul 2016 01:37:33 GMT
Hi,

Have you checked CamelSpringTestSupport?
http://camel.apache.org/spring-testing.html

You can specify the Camel context XML under test by simply overriding the
createApplicationContext method:

    protected AbstractXmlApplicationContext createApplicationContext() {
        return new
ClassPathXmlApplicationContext("META-INF/spring/your-context.xml");
    }

If you are using Blueprint XML then you can refer
to CamelBlueprintTestSupport.

On Tue, Jul 5, 2016 at 11:23 PM, Vanshul.Chawla <Vanshul.Chawla@target.com>
wrote:

> Thanks.
>
> I have seen this link.
>
> I had some doubts. I have camelcontext.xml which gets message from MQ and
> transforms and sends to a webservice, gets a response and then transforms
> and send back to another queue.
> I can mock the end points and can assert based on conditions etc.
>
> How to tell my test case class that I am using which camelcontext.xml? ie
> how to bind test case and xml together?
>
> -----Original Message-----
> From: Steve Huston [mailto:shuston@riverace.com]
> Sent: Tuesday, July 05, 2016 9:17 AM
> To: users@camel.apache.org
> Subject: RE: Unit test case for XML DSL context and routes
>
> http://camel.apache.org/testing.html
>
> > -----Original Message-----
> > From: Vanshul.Chawla [mailto:Vanshul.Chawla@target.com]
> > Sent: Tuesday, July 05, 2016 10:08 AM
> > To: users@camel.apache.org
> > Subject: Unit test case for XML DSL context and routes
> >
> > Hello All,
> >
> > We have some Camel code which is written in XML DSL. We need to add
> > unit test cases for each context(multiple routes) . Could someone
> > please give a lead to how this can be achieved.
> >
> > Vanshul
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message