ExchangeNotifierBuilder - Add a builder to building exchange notification 
predicates to be used for testing
-----------------------------------------------------------------------------------------------------------

                 Key: CAMEL-2357
                 URL: https://issues.apache.org/activemq/browse/CAMEL-2357
             Project: Apache Camel
          Issue Type: New Feature
          Components: camel-core
    Affects Versions: 2.1.0
            Reporter: Claus Ibsen
            Assignee: Claus Ibsen
             Fix For: 2.2.0


When doing unit testing and you do not use mocks or the likes to test when X 
number of message have completed etc.
Then we need some other form to do that and a fairly lightweight and simple 
builder can offer this in a intuitive way.

{code}
        ExchangeNotifierBuilder builder = new ExchangeNotifierBuilder(context)
                .from("direct:foo").whenExchangeDone(5)
                .create();
{code}

And you can stack with operations such as *and, or, not* etc:
{code}
        ExchangeNotifierBuilder builder = new ExchangeNotifierBuilder(context)
                .from("direct:foo").whenExchangeDone(5)
                .or().from("direct:bar").whenExchangeDone(7)
                .create();
{code}

Then you just assert whether it matched and there should be methods to wait as 
well

{code}
        assertEquals(true, builder.matches());
{code}

As well as a method to invoke a callback when its matching.

On top we can add to the builder so you can do fine grained expressions to 
indicate when this message is complete, or when 5 messages with header amount > 
100 is complete etc.
Basically if we can tap in the other builders then you would be able to archive 
that

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to