Hi

There is a lot of information about testing at
http://camel.apache.org/testing

And also in the books published
http://camel.apache.org/books


On Tue, Jan 14, 2014 at 9:53 PM, Castyn <eric.ben...@gmail.com> wrote:
> Greetings, I have a question around unit testing within Camel as I am fairly
> new to it.  I have a process:
>
>         public void setProcessStatus(Exchange exchange) throws Exception {
>                 String processName = 
> exchange.getIn().getHeader("process_name",
> String.class);
>                 String processStatus = 
> exchange.getIn().getHeader("process_status",
> String.class);
>
>                 JdbcEndpoint e = (JdbcEndpoint)
> exchange.getContext().getEndpoint("jdbc:mtgsServiceDataSource");
>                 JdbcProducer p = (JdbcProducer) e.createProducer();
>
> exchange.getIn().setBody(getUpdateProcessStatus(processName,processStatus));
>
>                 p.process(exchange);
>
>                 int result = (Integer) 
> exchange.getOut().getHeader("CamelJdbcUpdateCount",
> Integer.class);
>
>                 if(result <= 0)
>                         throw new InvalidProcessStateException("Process 
> Status unable to be
> updated");
>
>         }
>
> I am curious how it would be possible to setup the necessary aspects for a
> unit test of this method?  How do you setup an entire exchange in a unit
> test, or is there capabilities built in somewhere I am unaware of?
>
> Thanks for any help
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Unit-Testing-Question-tp5745966.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io

Reply via email to