Hi,
checkout the documentation[1] on Spring testing,

zoran

[1] https://camel.apache.org/spring-testing.html

On Tue, Jul 4, 2017 at 8:57 PM, yoav hhh <yoavgo...@gmail.com> wrote:
> I would like to use CamelSpringTestSupport in order to test my camel route.
> this is my camelContext :
>
>     <camelContext xmlns="http://camel.apache.org/schema/spring";>
>       <propertyPlaceholder id="incomingFileHandlerP"
>         location="classpath:incomingFileHandler.properties" />
>       <route>
>         <from uri="file://{{filesBaseDir}}?recursive=true&amp;move=.done"
> id="incomingFile"/>
>         <convertBodyTo type="java.lang.String" />
>         <to uri="bean:incomingFileHandler" id="incomingFileHandlerBean"/>
>
>         <log message='${exchangeProperty[incomingFileHandlerError]}' />
>         <choice>
>           <when>
>             <simple>${exchangeProperty[incomingFileHandlerError]} != 'null'
>             </simple>
>             <log message="incomingFileHandler error" />
>             <to uri="file://?fileName=C:/tmp/xxx.xml" />
>           </when>
>           <otherwise>
>             <to uri="file://?fileName=C:/tmp/yyy.xml" />
>           </otherwise>
>         </choice>
>       </route>
>     </camelContext>
>
> I want to be able to test (assert tests) the Exchange paremeters values
> after returning from incomingFileHandlerBean.
>
> So I have this Junit skeleton class:
>
>     @RunWith(SpringJUnit4ClassRunner.class)
>     public class Tests extends CamelSpringTestSupport {
>
>       @Test
>       public void test() throws InterruptedException {
>         ////// ??
>       }
>
>       @Override
>       protected AbstractApplicationContext createApplicationContext() {
>         return new
> ClassPathXmlApplicationContext("file:src/main/resources/META-INF/spring/applicationContext.xml");
>       }
>     }
>
> But I'm not sure how to fill the test method.
> I will be happy for any help.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/how-to-use-CamelSpringTestSupport-tp5805805.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Zoran Regvart

Reply via email to