You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by he...@apache.org on 2014/11/10 18:34:29 UTC
camel git commit: Enabled some ignored tests.
Repository: camel
Updated Branches:
refs/heads/master 7fb5c5843 -> 459a862ca
Enabled some ignored tests.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/459a862c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/459a862c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/459a862c
Branch: refs/heads/master
Commit: 459a862ca54dfbb5345a856846ba61c52d9bf0ee
Parents: 7fb5c58
Author: Henryk Konsek <he...@gmail.com>
Authored: Mon Nov 10 18:34:19 2014 +0100
Committer: Henryk Konsek <he...@gmail.com>
Committed: Mon Nov 10 18:34:19 2014 +0100
----------------------------------------------------------------------
.../component/mongodb/MongoDbHeaderHandlingTest.java | 15 +++++++--------
.../component/mongodb/MongoDbOperationsTest.java | 6 +++---
2 files changed, 10 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/459a862c/components/camel-mongodb/src/test/java/org/apache/camel/component/mongodb/MongoDbHeaderHandlingTest.java
----------------------------------------------------------------------
diff --git a/components/camel-mongodb/src/test/java/org/apache/camel/component/mongodb/MongoDbHeaderHandlingTest.java b/components/camel-mongodb/src/test/java/org/apache/camel/component/mongodb/MongoDbHeaderHandlingTest.java
index baa7267..e47317e 100644
--- a/components/camel-mongodb/src/test/java/org/apache/camel/component/mongodb/MongoDbHeaderHandlingTest.java
+++ b/components/camel-mongodb/src/test/java/org/apache/camel/component/mongodb/MongoDbHeaderHandlingTest.java
@@ -22,14 +22,12 @@ import com.mongodb.WriteResult;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
-import org.junit.Ignore;
import org.junit.Test;
public class MongoDbHeaderHandlingTest extends AbstractMongoDbTest {
- @Ignore
@Test
- public void testInHeadersTransferredToOut() {
+ public void testInHeadersTransferredToOutOnCount() {
// a read operation
assertEquals(0, testCollection.count());
Exchange result = template.request("direct:count", new Processor() {
@@ -42,21 +40,22 @@ public class MongoDbHeaderHandlingTest extends AbstractMongoDbTest {
assertTrue("Result is not of type Long", result.getOut().getBody() instanceof Long);
assertEquals("Test collection should not contain any records", 0L, result.getOut().getBody());
assertEquals("An input header was not returned", "def", result.getOut().getHeader("abc"));
-
- // a write operation
- result = template.request("direct:insert", new Processor() {
+ }
+
+ @Test
+ public void testInHeadersTransferredToOutOnInsert() {
+ Exchange result = template.request("direct:insert", new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
exchange.getIn().setBody("{\"_id\":\"testInsertString\", \"scientist\":\"Einstein\"}");
exchange.getIn().setHeader("abc", "def");
}
});
-
+
assertTrue(result.getOut().getBody() instanceof WriteResult);
assertEquals("An input header was not returned", "def", result.getOut().getHeader("abc"));
DBObject b = testCollection.findOne("testInsertString");
assertNotNull("No record with 'testInsertString' _id", b);
-
}
@Test
http://git-wip-us.apache.org/repos/asf/camel/blob/459a862c/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 2b15855..db14075 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
@@ -65,17 +65,17 @@ public class MongoDbOperationsTest extends AbstractMongoDbTest {
}
@Test
- public void testStoreOid() throws Exception {
+ public void testStoreOidOnInsert() throws Exception {
DBObject dbObject = new BasicDBObject();
ObjectId oid = template.requestBody("direct:testStoreOidOnInsert", dbObject, ObjectId.class);
assertEquals(dbObject.get("_id"), oid);
}
@Test
- public void testStoreOids() throws Exception {
+ public void testStoreOidsOnInsert() throws Exception {
DBObject firstDbObject = new BasicDBObject();
DBObject secondDbObject = new BasicDBObject();
- List<ObjectId> oids = template.requestBody("direct:testStoreOidOnInsert", asList(firstDbObject, secondDbObject), List.class);
+ List<?> oids = template.requestBody("direct:testStoreOidOnInsert", asList(firstDbObject, secondDbObject), List.class);
assertTrue(oids.contains(firstDbObject.get("_id")));
assertTrue(oids.contains(secondDbObject.get("_id")));
}