camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/2] camel git commit: CAMEL-9892 Renamed endpoints for readability
Date Thu, 21 Apr 2016 14:59:47 GMT
CAMEL-9892 Renamed endpoints for readability


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a1a4c2e0
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a1a4c2e0
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a1a4c2e0

Branch: refs/heads/master
Commit: a1a4c2e0974e6a6ec7d4364fab9523e13967008a
Parents: 622a71d
Author: Bob Gaudaen <bob.gaudaen@gmail.com>
Authored: Wed Apr 20 16:24:21 2016 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Thu Apr 21 16:57:27 2016 +0200

----------------------------------------------------------------------
 .../apache/camel/scala/dsl/AggregatorTest.scala | 70 ++++++++++----------
 1 file changed, 36 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/a1a4c2e0/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/AggregatorTest.scala
----------------------------------------------------------------------
diff --git a/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/AggregatorTest.scala
b/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/AggregatorTest.scala
index 874730e..dcb27bb 100644
--- a/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/AggregatorTest.scala
+++ b/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/AggregatorTest.scala
@@ -27,95 +27,97 @@ import org.apache.camel.builder.ExchangeBuilder.anExchange
  * Test case for message aggregator
  */
 class AggregatorTest extends ScalaTestSupport {
-  
+
   val count = 100
-  
+
   @Test
   def testSimpleAggregator() {
-    "mock:a" expect { _.received("message " + count) } 
+    "mock:aggregated" expect {
+      _.received("message " + count)
+    }
     test {
       for (i <- 1 to count) {
-        "direct:a" ! ("message " + i)
+        "direct:completion-size" ! ("message " + i)
       }
     }
   }
 
- @Test
- def testBlockAggregator() {
-    "mock:b" expect { _.received("message " + count) } 
+  @Test
+  def testBlockAggregator() {
+    "mock:aggregated" expect {
+      _.received("message " + count)
+    }
     test {
       for (i <- 1 to count) {
-        "direct:b" ! ("message " + i)
+        "direct:completion-size-block" ! ("message " + i)
       }
     }
   }
 
   @Test
   def testWrappingFunctionalAggregator() {
-    "mock:c" expect {
+    "mock:aggregated" expect {
       _.received("foobar")
     }
     test {
-      "direct:c" ! "foo"
-      "direct:c" ! "bar"
+      "direct:functional-aggregator-wrapped" ! "foo"
+      "direct:functional-aggregator-wrapped" ! "bar"
     }
   }
 
   @Test
   def testFunctionalAggregator() {
-    "mock:d" expect {
+    "mock:aggregated" expect {
       _.received("foobar")
     }
     test {
-      "direct:d" ! "foo"
-      "direct:d" ! "bar"
+      "direct:functional-aggregator" ! "foo"
+      "direct:functional-aggregator" ! "bar"
     }
   }
 
   @Test
   def testAggregateSimplePredicate() {
-    "mock:e" expect {
+    "mock:aggregated" expect {
       _.received("A+B+C")
     }
     test {
-      "direct:e" ! "A"
-      "direct:e" ! "B"
-      "direct:e" ! "C"
+      "direct:predicate" ! "A"
+      "direct:predicate" ! "B"
+      "direct:predicate" ! "C"
     }
   }
 
   val builder =
     new RouteBuilder {
-       "direct:a" ==> {
-         aggregate (_.in[String].substring(0, 7), new UseLatestAggregationStrategy()) completionSize
100 to "mock:a" }
+      "direct:completion-size" ==> {
+        aggregate(_.in[String].substring(0, 7), new UseLatestAggregationStrategy()) completionSize
count to "mock:aggregated"
+      }
 
-       //START SNIPPET: block
-       "direct:b" ==> {
-         aggregate(_.in[String].substring(0,7), new UseLatestAggregationStrategy()).completionSize(100)
{
-           to ("mock:b")
-         }
-       }
-       //END SNIPPET: block
+      "direct:completion-size-block" ==> {
+        aggregate(_.in[String].substring(0, 7), new UseLatestAggregationStrategy()).completionSize(count)
{
+          to("mock:aggregated")
+        }
+      }
 
-      "direct:c" ==> {
+      "direct:functional-aggregator-wrapped" ==> {
         val aggregator = (oldEx: Exchange, newEx: Exchange) => oldEx match {
           case null => newEx.in[String]
           case _ => oldEx.in[String] + newEx.in[String]
         }
-        aggregate ("constant", aggregator) completionSize 2 to "mock:c"
+        aggregate("constant", aggregator) completionSize 2 to "mock:aggregated"
       }
 
-      "direct:d" ==> {
+      "direct:functional-aggregator" ==> {
         val aggregator = (oldEx: Exchange, newEx: Exchange) => oldEx match {
           case null => newEx
           case _ => anExchange(newEx.getContext).withBody(oldEx.in[String] + newEx.in[String]).build
         }
-        aggregate ("constant", aggregator) completionSize 2 to "mock:d"
+        aggregate("constant", aggregator) completionSize 2 to "mock:aggregated"
       }
 
-      "direct:e" ==> {
-        aggregate("constant", new BodyInAggregatingStrategy()) completionPredicate(_.in[String].contains("A+B+C"))
to "mock:e"
+      "direct:predicate" ==> {
+        aggregate("constant", new BodyInAggregatingStrategy()) completionPredicate (_.in[String].contains("A+B+C"))
to "mock:aggregated"
       }
     }
-
 }
\ No newline at end of file


Mime
View raw message