camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject git commit: CAMEL-6507 : Typo correction of aggregate with thanks to Raul and Pierre-Alban
Date Fri, 05 Jul 2013 01:50:20 GMT
Updated Branches:
  refs/heads/master bdad710a3 -> 900b9bd9c


CAMEL-6507 : Typo correction of aggregate with thanks to Raul and Pierre-Alban


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

Branch: refs/heads/master
Commit: 900b9bd9cf77198d6d53a61c3ef1478b185b4614
Parents: bdad710
Author: Willem Jiang <ningjiang@apache.org>
Authored: Fri Jul 5 09:12:34 2013 +0800
Committer: Willem Jiang <ningjiang@apache.org>
Committed: Fri Jul 5 09:12:34 2013 +0800

----------------------------------------------------------------------
 .../camel/component/mongodb/MongoDbOperation.java   |  2 +-
 .../camel/component/mongodb/MongoDbProducer.java    | 16 ++++++++--------
 .../component/mongodb/MongoDbOperationsTest.java    |  6 +++---
 3 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/900b9bd9/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoDbOperation.java
----------------------------------------------------------------------
diff --git a/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoDbOperation.java
b/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoDbOperation.java
index 710c119..bb6ee6a 100644
--- a/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoDbOperation.java
+++ b/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoDbOperation.java
@@ -34,7 +34,7 @@ public enum MongoDbOperation {
     remove, 
     
     //aggregat
-    aggregat,
+    aggregate,
     
     // others
     getDbStats, 

http://git-wip-us.apache.org/repos/asf/camel/blob/900b9bd9/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoDbProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoDbProducer.java
b/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoDbProducer.java
index 7cd4022..166c62b 100644
--- a/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoDbProducer.java
+++ b/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoDbProducer.java
@@ -116,8 +116,8 @@ public class MongoDbProducer extends DefaultProducer {
             doRemove(exchange);
             break;
         
-        case aggregat:
-            doAggregat(exchange);
+        case aggregate:
+            doAggregate(exchange);
             break;
         
         case getDbStats:
@@ -352,27 +352,27 @@ public class MongoDbProducer extends DefaultProducer {
     * @param exchange
     * @throws Exception
     */
-    protected void doAggregat(Exchange exchange) throws Exception {
+    protected void doAggregate(Exchange exchange) throws Exception {
         DBCollection dbCol = calculateCollection(exchange);
         DBObject query = exchange.getIn().getMandatoryBody(DBObject.class);
 
         // Impossible with java driver to get the batch size and number to skip
         Iterable<DBObject> dbIterator = null;
         try {
-            AggregationOutput agregationResult = null;
+            AggregationOutput aggregationResult = null;
 
             // Allow body to be a pipeline
             // @see http://docs.mongodb.org/manual/core/aggregation/
             if (query instanceof BasicDBList) {
                 BasicDBList queryList = (BasicDBList)query;
-                agregationResult = dbCol.aggregate((DBObject)queryList.get(0), (BasicDBObject[])queryList
+                aggregationResult = dbCol.aggregate((DBObject)queryList.get(0), (BasicDBObject[])queryList
                     .subList(1, queryList.size()).toArray(new BasicDBObject[queryList.size()
- 1]));
             } else {
-                agregationResult = dbCol.aggregate(query);
+                aggregationResult = dbCol.aggregate(query);
             }
 
-            dbIterator = agregationResult.results();
-            Message resultMessage = prepareResponseMessage(exchange, MongoDbOperation.aggregat);
+            dbIterator = aggregationResult.results();
+            Message resultMessage = prepareResponseMessage(exchange, MongoDbOperation.aggregate);
             resultMessage.setBody(dbIterator);
 
             // Mongo Driver does not allow to read size and to paginate aggregate result

http://git-wip-us.apache.org/repos/asf/camel/blob/900b9bd9/components/camel-mongodb/src/test/java/org/apache/camel/component/mongodb/MongoDbOperationsTest.java
----------------------------------------------------------------------
diff --git a/components/camel-mongodb/src/test/java/org/apache/camel/component/mongodb/MongoDbOperationsTest.java
b/components/camel-mongodb/src/test/java/org/apache/camel/component/mongodb/MongoDbOperationsTest.java
index c3bed5e..87fc9ce 100644
--- a/components/camel-mongodb/src/test/java/org/apache/camel/component/mongodb/MongoDbOperationsTest.java
+++ b/components/camel-mongodb/src/test/java/org/apache/camel/component/mongodb/MongoDbOperationsTest.java
@@ -159,14 +159,14 @@ public class MongoDbOperationsTest extends AbstractMongoDbTest {
     }
     
     @Test
-    public void testAgregat() throws Exception {
+    public void testAggregate() throws Exception {
         // Test that the collection has 0 documents in it
         assertEquals(0, testCollection.count());
         pumpDataIntoTestCollection();
 
         // Repeat ten times, obtain 10 batches of 100 results each time
         Object result = template
-            .requestBody("direct:aggregat",
+            .requestBody("direct:aggregate",
                          "[{ $match : {$or : [{\"scientist\" : \"Darwin\"},{\"scientist\"
: \"Einstein\"}]}},{ $group: { _id: \"$scientist\", count: { $sum: 1 }} } ]");
         assertTrue("Result is not of type List", result instanceof List);
 
@@ -230,7 +230,7 @@ public class MongoDbOperationsTest extends AbstractMongoDbTest {
                 from("direct:save").to("mongodb:myDb?database={{mongodb.testDb}}&collection={{mongodb.testCollection}}&operation=save&writeConcern=SAFE");
                 from("direct:update").to("mongodb:myDb?database={{mongodb.testDb}}&collection={{mongodb.testCollection}}&operation=update&writeConcern=SAFE");
                 from("direct:remove").to("mongodb:myDb?database={{mongodb.testDb}}&collection={{mongodb.testCollection}}&operation=remove&writeConcern=SAFE");
-                from("direct:aggregat").to("mongodb:myDb?database={{mongodb.testDb}}&collection={{mongodb.testCollection}}&operation=aggregat&writeConcern=SAFE");
+                from("direct:aggregate").to("mongodb:myDb?database={{mongodb.testDb}}&collection={{mongodb.testCollection}}&operation=aggregate&writeConcern=SAFE");
                 from("direct:getDbStats").to("mongodb:myDb?database={{mongodb.testDb}}&collection={{mongodb.testCollection}}&operation=getDbStats");
                 from("direct:getColStats").to("mongodb:myDb?database={{mongodb.testDb}}&collection={{mongodb.testCollection}}&operation=getColStats");
 


Mime
View raw message