You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Mick Knutson <mk...@baselogic.com> on 2008/09/30 01:19:29 UTC

How do I unit test a wire tap?

I am wondering how I would unit test a wire tap? Do I just create the tap as
a mock and use the following cfg:

            public void configure() {

                from(inputUri)
                        .errorHandler(

deadLetterChannel(MOCK_OUTPUT_DESTINATION_URI)
                                        .maximumRedeliveries(2)
                                        .initialRedeliveryDelay(1)
                                        .loggingLevel(LoggingLevel.INFO)
                        )
                        .process(processor)
                        .to(*MOCK_TAP, *MOCK_OUTPUT_DESTINATION_URI);
            }
        });


-- 
---
Thank You…

Mick Knutson
BASE Logic, inc.
(415) 354-4215

Website: http://baselogic.com
Blog: http://baselogic.com/blog
BLiNC Magazine: http://blincmagazine.com
Linked IN: http://linkedin.com/in/mickknutson
DJ Mick: http://djmick.com
MySpace: http://myspace.com/mickknutson
Vacation Rental: http://tahoe.baselogic.com

Re: How do I unit test a wire tap?

Posted by Jon Anstey <ja...@gmail.com>.
Yeah, you can just use a mock endpoint to test the wire tap pattern. I've
added a test case here
http://svn.apache.org/repos/asf/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WireTapTest.javaso
folks will know how to do this in the future.

On Mon, Sep 29, 2008 at 8:49 PM, Mick Knutson <mk...@baselogic.com>wrote:

> I am wondering how I would unit test a wire tap? Do I just create the tap
> as
> a mock and use the following cfg:
>
>            public void configure() {
>
>                from(inputUri)
>                        .errorHandler(
>
> deadLetterChannel(MOCK_OUTPUT_DESTINATION_URI)
>                                        .maximumRedeliveries(2)
>                                        .initialRedeliveryDelay(1)
>                                        .loggingLevel(LoggingLevel.INFO)
>                        )
>                        .process(processor)
>                        .to(*MOCK_TAP, *MOCK_OUTPUT_DESTINATION_URI);
>            }
>        });
>
>
> --
> ---
> Thank You…
>
> Mick Knutson
> BASE Logic, inc.
> (415) 354-4215
>
> Website: http://baselogic.com
> Blog: http://baselogic.com/blog
> BLiNC Magazine: http://blincmagazine.com
> Linked IN: http://linkedin.com/in/mickknutson
> DJ Mick: http://djmick.com
> MySpace: http://myspace.com/mickknutson
> Vacation Rental: http://tahoe.baselogic.com
>



-- 
Cheers,
Jon

http://janstey.blogspot.com/