camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r899164 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/builder/ test/java/org/apache/camel/builder/
Date Thu, 14 Jan 2010 11:44:56 GMT
Author: davsclaus
Date: Thu Jan 14 11:44:55 2010
New Revision: 899164

URL: http://svn.apache.org/viewvc?rev=899164&view=rev
Log:
CAMEL-2357: Added additional methods for builder, including a neat whenSatisfied which leverages
a Mock so you can set fine grained expectations on that mock.

Added:
    camel/trunk/camel-core/src/main/java/org/apache/camel/builder/NotifierBuilder.java   (contents,
props changed)
      - copied, changed from r899147, camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExchangeNotifierBuilder.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/builder/NotifierBuilderTest.java
  (contents, props changed)
      - copied, changed from r899147, camel/trunk/camel-core/src/test/java/org/apache/camel/builder/ExchangeNotifierBuilderTest.java
Removed:
    camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExchangeNotifierBuilder.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/builder/ExchangeNotifierBuilderTest.java

Copied: camel/trunk/camel-core/src/main/java/org/apache/camel/builder/NotifierBuilder.java
(from r899147, camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExchangeNotifierBuilder.java)
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/NotifierBuilder.java?p2=camel/trunk/camel-core/src/main/java/org/apache/camel/builder/NotifierBuilder.java&p1=camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExchangeNotifierBuilder.java&r1=899147&r2=899164&rev=899164&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExchangeNotifierBuilder.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/builder/NotifierBuilder.java Thu
Jan 14 11:44:55 2010
@@ -48,15 +48,15 @@
  *
  * @version $Revision$
  */
-public class ExchangeNotifierBuilder {
+public class NotifierBuilder {
 
     // notifier to hook into Camel to listen for events
-    private final EventNotifier notifier = new ExchangeNotifier();
+    private final EventNotifier eventNotifier = new ExchangeNotifier();
 
     // the predicates build with this builder
     private final List<EventPredicateHolder> predicates = new ArrayList<EventPredicateHolder>();
 
-    // latch to be used if waiting for condition
+    // latch to be used to signal predicates matches
     private final CountDownLatch latch = new CountDownLatch(1);
 
     // the current state while building an event predicate where we use a stack and the operation
@@ -71,13 +71,13 @@
      *
      * @param context the Camel context
      */
-    public ExchangeNotifierBuilder(CamelContext context) {
+    public NotifierBuilder(CamelContext context) {
         try {
-            ServiceHelper.startService(notifier);
+            ServiceHelper.startService(eventNotifier);
         } catch (Exception e) {
             throw ObjectHelper.wrapRuntimeCamelException(e);
         }
-        context.getManagementStrategy().addEventNotifier(notifier);
+        context.getManagementStrategy().addEventNotifier(eventNotifier);
     }
 
     /**
@@ -88,7 +88,7 @@
      * @return the builder
      * @see org.apache.camel.util.EndpointHelper#matchEndpoint(String, String)
      */
-    public ExchangeNotifierBuilder from(final String endpointUri) {
+    public NotifierBuilder from(final String endpointUri) {
         stack.push(new EventPredicateSupport() {
 
             @Override
@@ -127,7 +127,7 @@
      * @param number at least number of messages
      * @return the builder
      */
-    public ExchangeNotifierBuilder whenReceived(final int number) {
+    public NotifierBuilder whenReceived(final int number) {
         stack.push(new EventPredicateSupport() {
             private int current;
 
@@ -161,7 +161,7 @@
      * @param number at least number of messages
      * @return the builder
      */
-    public ExchangeNotifierBuilder whenDone(final int number) {
+    public NotifierBuilder whenDone(final int number) {
         stack.add(new EventPredicateSupport() {
             private int current;
 
@@ -201,7 +201,7 @@
      * @param number at least number of messages
      * @return the builder
      */
-    public ExchangeNotifierBuilder whenCompleted(final int number) {
+    public NotifierBuilder whenCompleted(final int number) {
         stack.add(new EventPredicateSupport() {
             private int current;
 
@@ -232,7 +232,7 @@
      * @param number at least number of messages
      * @return the builder
      */
-    public ExchangeNotifierBuilder whenFailed(final int number) {
+    public NotifierBuilder whenFailed(final int number) {
         stack.add(new EventPredicateSupport() {
             private int current;
 
@@ -262,7 +262,7 @@
      * @param number exactly number of messages
      * @return the builder
      */
-    public ExchangeNotifierBuilder whenExactlyDone(final int number) {
+    public NotifierBuilder whenExactlyDone(final int number) {
         stack.add(new EventPredicateSupport() {
             private int current;
 
@@ -299,7 +299,7 @@
      * @param number exactly number of messages
      * @return the builder
      */
-    public ExchangeNotifierBuilder whenExactlyCompleted(final int number) {
+    public NotifierBuilder whenExactlyCompleted(final int number) {
         stack.add(new EventPredicateSupport() {
             private int current;
 
@@ -327,7 +327,7 @@
      * @param number exactly number of messages
      * @return the builder
      */
-    public ExchangeNotifierBuilder whenExactlyFailed(final int number) {
+    public NotifierBuilder whenExactlyFailed(final int number) {
         stack.add(new EventPredicateSupport() {
             private int current;
 
@@ -355,7 +355,7 @@
      * @param predicate the predicate
      * @return the builder
      */
-    public ExchangeNotifierBuilder whenAnyReceivedMatches(final Predicate predicate) {
+    public NotifierBuilder whenAnyReceivedMatches(final Predicate predicate) {
         stack.push(new EventPredicateSupport() {
             private boolean matches;
 
@@ -373,7 +373,7 @@
 
             @Override
             public String toString() {
-                return "whenAntReceivedMatches(" + predicate + ")";
+                return "whenAnyReceivedMatches(" + predicate + ")";
             }
         });
         return this;
@@ -385,7 +385,7 @@
      * @param predicate the predicate
      * @return the builder
      */
-    public ExchangeNotifierBuilder whenAllReceivedMatches(final Predicate predicate) {
+    public NotifierBuilder whenAllReceivedMatches(final Predicate predicate) {
         stack.push(new EventPredicateSupport() {
             private boolean matches = true;
 
@@ -421,7 +421,7 @@
      * @param mock the mock
      * @return the builder
      */
-    public ExchangeNotifierBuilder whenSatisfied(final MockEndpoint mock) {
+    public NotifierBuilder whenSatisfied(final MockEndpoint mock) {
         stack.push(new EventPredicateSupport() {
 
             private Producer producer;
@@ -459,7 +459,7 @@
 
             @Override
             public String toString() {
-                return "whenMock(" + mock + ")";
+                return "whenSatisfied(" + mock + ")";
             }
         });
         return this;
@@ -471,7 +471,7 @@
      *
      * @return the builder
      */
-    public ExchangeNotifierBuilder and() {
+    public NotifierBuilder and() {
         doCreate(EventOperation.and);
         return this;
     }
@@ -481,7 +481,7 @@
      *
      * @return the builder
      */
-    public ExchangeNotifierBuilder or() {
+    public NotifierBuilder or() {
         doCreate(EventOperation.or);
         return this;
     }
@@ -491,7 +491,7 @@
      *
      * @return the builder
      */
-    public ExchangeNotifierBuilder not() {
+    public NotifierBuilder not() {
         doCreate(EventOperation.not);
         return this;
     }
@@ -503,7 +503,7 @@
      *
      * @return the created builder ready for matching
      */
-    public ExchangeNotifierBuilder create() {
+    public NotifierBuilder create() {
         doCreate(EventOperation.and);
         return this;
     }

Propchange: camel/trunk/camel-core/src/main/java/org/apache/camel/builder/NotifierBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/camel-core/src/main/java/org/apache/camel/builder/NotifierBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: camel/trunk/camel-core/src/test/java/org/apache/camel/builder/NotifierBuilderTest.java
(from r899147, camel/trunk/camel-core/src/test/java/org/apache/camel/builder/ExchangeNotifierBuilderTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/NotifierBuilderTest.java?p2=camel/trunk/camel-core/src/test/java/org/apache/camel/builder/NotifierBuilderTest.java&p1=camel/trunk/camel-core/src/test/java/org/apache/camel/builder/ExchangeNotifierBuilderTest.java&r1=899147&r2=899164&rev=899164&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/builder/ExchangeNotifierBuilderTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/builder/NotifierBuilderTest.java
Thu Jan 14 11:44:55 2010
@@ -24,16 +24,16 @@
 /**
  * @version $Revision$
  */
-public class ExchangeNotifierBuilderTest extends ContextTestSupport {
+public class NotifierBuilderTest extends ContextTestSupport {
 
     public void testWhenExchangeDone() throws Exception {
-        ExchangeNotifierBuilder builder = new ExchangeNotifierBuilder(context)
+        NotifierBuilder notifier  = new NotifierBuilder(context)
                 .from("direct:foo").whenDone(5)
                 .create();
 
-        assertEquals("from(direct:foo).whenDone(5)", builder.toString());
+        assertEquals("from(direct:foo).whenDone(5)", notifier .toString());
 
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:foo", "A");
         template.sendBody("direct:foo", "B");
@@ -42,26 +42,26 @@
         template.sendBody("direct:bar", "D");
         template.sendBody("direct:bar", "E");
 
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:foo", "F");
         template.sendBody("direct:bar", "G");
 
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:foo", "H");
         template.sendBody("direct:bar", "I");
 
-        assertEquals(true, builder.matches());
+        assertEquals(true, notifier .matches());
     }
 
     public void testWhenExchangeDoneAnd() throws Exception {
-        ExchangeNotifierBuilder builder = new ExchangeNotifierBuilder(context)
+        NotifierBuilder notifier = new NotifierBuilder(context)
                 .from("direct:foo").whenDone(5)
                 .and().from("direct:bar").whenDone(7)
                 .create();
 
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:foo", "A");
         template.sendBody("direct:foo", "B");
@@ -70,34 +70,34 @@
         template.sendBody("direct:bar", "D");
         template.sendBody("direct:bar", "E");
 
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:foo", "F");
         template.sendBody("direct:bar", "G");
 
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:foo", "H");
         template.sendBody("direct:bar", "I");
 
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:bar", "J");
         template.sendBody("direct:bar", "K");
         template.sendBody("direct:bar", "L");
 
-        assertEquals(true, builder.matches());
+        assertEquals(true, notifier .matches());
     }
 
     public void testWhenExchangeDoneOr() throws Exception {
-        ExchangeNotifierBuilder builder = new ExchangeNotifierBuilder(context)
+        NotifierBuilder notifier  = new NotifierBuilder(context)
                 .from("direct:foo").whenDone(5)
                 .or().from("direct:bar").whenDone(7)
                 .create();
 
-        assertEquals("from(direct:foo).whenDone(5).or().from(direct:bar).whenDone(7)", builder.toString());
+        assertEquals("from(direct:foo).whenDone(5).or().from(direct:bar).whenDone(7)", notifier
.toString());
 
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:foo", "A");
         template.sendBody("direct:foo", "B");
@@ -106,64 +106,64 @@
         template.sendBody("direct:bar", "D");
         template.sendBody("direct:bar", "E");
 
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:bar", "G");
 
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:bar", "I");
 
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:bar", "J");
         template.sendBody("direct:bar", "K");
         template.sendBody("direct:bar", "L");
 
-        assertEquals(true, builder.matches());
+        assertEquals(true, notifier .matches());
     }
 
     public void testWhenExchangeDoneNot() throws Exception {
-        ExchangeNotifierBuilder builder = new ExchangeNotifierBuilder(context)
+        NotifierBuilder notifier  = new NotifierBuilder(context)
                 .from("direct:foo").whenDone(5)
                 .not().from("direct:bar").whenDone(1)
                 .create();
 
-        assertEquals("from(direct:foo).whenDone(5).not().from(direct:bar).whenDone(1)", builder.toString());
+        assertEquals("from(direct:foo).whenDone(5).not().from(direct:bar).whenDone(1)", notifier
.toString());
 
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:foo", "A");
         template.sendBody("direct:foo", "B");
         template.sendBody("direct:foo", "C");
         template.sendBody("direct:foo", "D");
 
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
         template.sendBody("direct:foo", "E");
-        assertEquals(true, builder.matches());
+        assertEquals(true, notifier .matches());
 
         template.sendBody("direct:foo", "F");
-        assertEquals(true, builder.matches());
+        assertEquals(true, notifier .matches());
 
         template.sendBody("direct:bar", "G");
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
     }
 
     public void testWhenExchangeDoneOrFailure() throws Exception {
-        ExchangeNotifierBuilder builder = new ExchangeNotifierBuilder(context)
+        NotifierBuilder notifier  = new NotifierBuilder(context)
                 .whenDone(5)
                 .or().whenFailed(1)
                 .create();
 
-        assertEquals("whenDone(5).or().whenFailed(1)", builder.toString());
+        assertEquals("whenDone(5).or().whenFailed(1)", notifier .toString());
 
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:foo", "A");
         template.sendBody("direct:foo", "B");
         template.sendBody("direct:foo", "D");
 
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         try {
             template.sendBody("direct:fail", "E");
@@ -171,16 +171,16 @@
             // ignore
         }
 
-        assertEquals(true, builder.matches());
+        assertEquals(true, notifier .matches());
     }
 
     public void testWhenExchangeDoneNotFailure() throws Exception {
-        ExchangeNotifierBuilder builder = new ExchangeNotifierBuilder(context)
+        NotifierBuilder notifier  = new NotifierBuilder(context)
                 .whenDone(5)
                 .not().whenFailed(1)
                 .create();
 
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:foo", "A");
         template.sendBody("direct:foo", "B");
@@ -188,7 +188,7 @@
         template.sendBody("direct:bar", "E");
         template.sendBody("direct:bar", "F");
 
-        assertEquals(true, builder.matches());
+        assertEquals(true, notifier .matches());
 
         try {
             template.sendBody("direct:fail", "G");
@@ -196,15 +196,15 @@
             // ignore
         }
 
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
     }
 
     public void testWhenExchangeCompleted() throws Exception {
-        ExchangeNotifierBuilder builder = new ExchangeNotifierBuilder(context)
+        NotifierBuilder notifier  = new NotifierBuilder(context)
                 .whenCompleted(5)
                 .create();
 
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:foo", "A");
         template.sendBody("direct:foo", "B");
@@ -223,18 +223,18 @@
         }
 
         // should NOT be completed as it only counts successful exchanges
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:bar", "F");
         template.sendBody("direct:foo", "G");
         template.sendBody("direct:bar", "H");
 
         // now it should match
-        assertEquals(true, builder.matches());
+        assertEquals(true, notifier .matches());
     }
 
     public void testWhenExchangeReceivedWithDelay() throws Exception {
-        ExchangeNotifierBuilder builder = new ExchangeNotifierBuilder(context)
+        NotifierBuilder notifier  = new NotifierBuilder(context)
                 .whenReceived(1)
                 .create();
 
@@ -243,17 +243,17 @@
         long end = System.currentTimeMillis();
         assertTrue("Should be faster than: " + (end-start), (end-start) < 1500);
 
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         // should be quick as its when received and NOT when done
-        assertEquals(true, builder.matches(5, TimeUnit.SECONDS));
+        assertEquals(true, notifier .matches(5, TimeUnit.SECONDS));
         long end2 = System.currentTimeMillis();
 
         assertTrue("Should be faster than: " + (end2-start), (end2-start) < 1500);
     }
 
     public void testWhenExchangeDoneWithDelay() throws Exception {
-        ExchangeNotifierBuilder builder = new ExchangeNotifierBuilder(context)
+        NotifierBuilder notifier  = new NotifierBuilder(context)
                 .whenDone(1)
                 .create();
 
@@ -262,79 +262,79 @@
         long end = System.currentTimeMillis();
         assertTrue("Should be faster than: " + (end-start), (end-start) < 1500);
 
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         // should NOT be quick as its when DONE
-        assertEquals(true, builder.matches(5, TimeUnit.SECONDS));
+        assertEquals(true, notifier .matches(5, TimeUnit.SECONDS));
         long end2 = System.currentTimeMillis();
 
         assertTrue("Should be slower than: " + (end2-start), (end2-start) > 2900);
     }
 
     public void testWhenExchangeDoneAndTimeoutWithDelay() throws Exception {
-        ExchangeNotifierBuilder builder = new ExchangeNotifierBuilder(context)
+        NotifierBuilder notifier  = new NotifierBuilder(context)
                 .whenDone(1)
                 .create();
 
         template.sendBody("seda:cheese", "Hello Cheese");
 
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         // should timeout
-        assertEquals(false, builder.matches(1, TimeUnit.SECONDS));
+        assertEquals(false, notifier .matches(1, TimeUnit.SECONDS));
 
         // should NOT timeout
-        assertEquals(true, builder.matches(5, TimeUnit.SECONDS));
+        assertEquals(true, notifier .matches(5, TimeUnit.SECONDS));
     }
 
     public void testWhenExchangeExactlyDone() throws Exception {
-        ExchangeNotifierBuilder builder = new ExchangeNotifierBuilder(context)
+        NotifierBuilder notifier  = new NotifierBuilder(context)
                 .whenExactlyDone(5)
                 .create();
 
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:foo", "A");
         template.sendBody("direct:foo", "B");
         template.sendBody("direct:foo", "C");
 
         template.sendBody("direct:bar", "D");
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:bar", "E");
-        assertEquals(true, builder.matches());
+        assertEquals(true, notifier .matches());
 
         template.sendBody("direct:foo", "F");
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
     }
 
     public void testWhenExchangeExactlyComplete() throws Exception {
-        ExchangeNotifierBuilder builder = new ExchangeNotifierBuilder(context)
+        NotifierBuilder notifier  = new NotifierBuilder(context)
                 .whenExactlyCompleted(5)
                 .create();
 
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:foo", "A");
         template.sendBody("direct:foo", "B");
         template.sendBody("direct:foo", "C");
 
         template.sendBody("direct:bar", "D");
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:bar", "E");
-        assertEquals(true, builder.matches());
+        assertEquals(true, notifier .matches());
 
         template.sendBody("direct:foo", "F");
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
     }
 
     public void testWhenExchangeExactlyFailed() throws Exception {
-        ExchangeNotifierBuilder builder = new ExchangeNotifierBuilder(context)
+        NotifierBuilder notifier  = new NotifierBuilder(context)
                 .whenExactlyFailed(2)
                 .create();
 
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:foo", "A");
         template.sendBody("direct:foo", "B");
@@ -347,58 +347,58 @@
         }
 
         template.sendBody("direct:bar", "E");
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         try {
             template.sendBody("direct:fail", "F");
         } catch (Exception e) {
             // ignore
         }
-        assertEquals(true, builder.matches());
+        assertEquals(true, notifier .matches());
 
         template.sendBody("direct:bar", "G");
-        assertEquals(true, builder.matches());
+        assertEquals(true, notifier .matches());
 
         try {
             template.sendBody("direct:fail", "H");
         } catch (Exception e) {
             // ignore
         }
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
     }
 
     public void testWhenAnyReceivedMatches() throws Exception {
-        ExchangeNotifierBuilder builder = new ExchangeNotifierBuilder(context)
+        NotifierBuilder notifier  = new NotifierBuilder(context)
                 .whenAnyReceivedMatches(body().contains("Camel"))
                 .create();
 
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:foo", "Hello World");
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:foo", "Bye World");
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:bar", "Hello Camel");
-        assertEquals(true, builder.matches());
+        assertEquals(true, notifier .matches());
     }
 
     public void testWhenAllReceivedMatches() throws Exception {
-        ExchangeNotifierBuilder builder = new ExchangeNotifierBuilder(context)
+        NotifierBuilder notifier  = new NotifierBuilder(context)
                 .whenAllReceivedMatches(body().contains("Camel"))
                 .create();
 
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:foo", "Hello Camel");
-        assertEquals(true, builder.matches());
+        assertEquals(true, notifier .matches());
 
         template.sendBody("direct:foo", "Bye Camel");
-        assertEquals(true, builder.matches());
+        assertEquals(true, notifier .matches());
 
         template.sendBody("direct:bar", "Hello World");
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
     }
 
     public void testWhenSatisfied() throws Exception {
@@ -407,57 +407,57 @@
         MockEndpoint mock = getMockEndpoint("mock:assert");
         mock.expectedBodiesReceivedInAnyOrder("Hello World", "Bye World", "Hi World");
 
-        ExchangeNotifierBuilder builder = new ExchangeNotifierBuilder(context)
+        NotifierBuilder notifier  = new NotifierBuilder(context)
                 .from("direct:foo").whenSatisfied(mock)
                 .create();
 
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:foo", "Bye World");
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:foo", "Hello World");
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
-        // the builder is based on direct:foo so sending to bar should not trigger match
+        // the notifier  is based on direct:foo so sending to bar should not trigger match
         template.sendBody("direct:bar", "Hi World");
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:foo", "Hi World");
-        assertEquals(true, builder.matches());
+        assertEquals(true, notifier .matches());
     }
 
     public void testComplexOrCamel() throws Exception {
         MockEndpoint mock = getMockEndpoint("mock:assert");
         mock.expectedBodiesReceivedInAnyOrder("Hello World", "Bye World", "Hi World");
 
-        ExchangeNotifierBuilder builder = new ExchangeNotifierBuilder(context)
+        NotifierBuilder notifier  = new NotifierBuilder(context)
                 .from("direct:foo").whenSatisfied(mock)
                 .and().from("direct:bar").whenExactlyDone(5).whenAnyReceivedMatches(body().contains("Camel"))
                 .create();
 
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:foo", "Bye World");
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:foo", "Hello World");
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
-        // the builder is based on direct:foo so sending to bar should not trigger match
+        // the notifier  is based on direct:foo so sending to bar should not trigger match
         template.sendBody("direct:bar", "Hi World");
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:foo", "Hi World");
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:bar", "Hi Camel");
-        assertEquals(false, builder.matches());
+        assertEquals(false, notifier .matches());
 
         template.sendBody("direct:bar", "A");
         template.sendBody("direct:bar", "B");
         template.sendBody("direct:bar", "C");
-        assertEquals(true, builder.matches());
+        assertEquals(true, notifier .matches());
     }
 
     @Override

Propchange: camel/trunk/camel-core/src/test/java/org/apache/camel/builder/NotifierBuilderTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/camel-core/src/test/java/org/apache/camel/builder/NotifierBuilderTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



Mime
View raw message