mock testing question about failure mock destination.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

mock testing question about failure mock destination.

BASE Logic, Inc.
So I have a mock:failure destination that is getting 2 messages during my
test. I assert there should be 1 message.
I assume that the reason I am getting 2 messages is because of a retry. Is
this true?

here is my route:
            *public void configure() {
                errorHandler(
                        deadLetterChannel()
                                .exceptionPolicyStrategy(new
ChangeRequestExceptionPolicy())
                );

                onException(ChangeRequestExceptionPolicy.class)
                        .maximumRedeliveries(1)
                        .setHeader("MESSAGE_INFO", constant("Damm my policy
exception"))
                        .to(outputErrorUri);

                onException(CamelException.class)
                        .maximumRedeliveries(1)
                        .setHeader("MESSAGE_INFO", constant("Damm a Camel
exception"))
                        .to(outputErrorUri);

                onException(RuntimeException.class)
                        .maximumRedeliveries(1)
                        .setHeader("MESSAGE_INFO", constant("Damm a
RuntimeException"))
                        .to(outputErrorUri);

                from(inputUri)

.errorHandler(deadLetterChannel(outputErrorUri).maximumRedeliveries(1))
                        .process(processor)
                        .to(outputUri);
            }
        };
*


Then another question is, should I change my test from:
*expectedMessageCount(1)
*

to:
*expectedMinimumMessageCount(1)
*



--
---
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