camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/3] git commit: Added unit test based on user forum issue
Date Thu, 10 Oct 2013 13:46:08 GMT
Added unit test based on user forum issue


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

Branch: refs/heads/camel-2.11.x
Commit: 0fc5fbd2923edb405d6e3069d55cb66538b433e0
Parents: 4e42d45
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Thu Oct 10 15:43:16 2013 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Thu Oct 10 15:43:39 2013 +0200

----------------------------------------------------------------------
 .../camel/language/simple/SimpleTest.java       | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/0fc5fbd2/camel-core/src/test/java/org/apache/camel/language/simple/SimpleTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/language/simple/SimpleTest.java b/camel-core/src/test/java/org/apache/camel/language/simple/SimpleTest.java
index bc85a0f..f2e9bb0 100644
--- a/camel-core/src/test/java/org/apache/camel/language/simple/SimpleTest.java
+++ b/camel-core/src/test/java/org/apache/camel/language/simple/SimpleTest.java
@@ -1270,6 +1270,26 @@ public class SimpleTest extends LanguageTestSupport {
         assertExpression("${body.length}", 3);
     }
 
+    public void testSimpleMapBoolean() throws Exception {
+        Map map = new HashMap();
+        exchange.getIn().setBody(map);
+
+        map.put("isCredit", true);
+        assertPredicate("${body[isCredit]} == true", true);
+        assertPredicate("${body[isCredit]} == false", false);
+        assertPredicate("${body['isCredit']} == true", true);
+        assertPredicate("${body['isCredit']} == false", false);
+
+        // wrong case
+        assertPredicate("${body['IsCredit']} == true", false);
+
+        map.put("isCredit", false);
+        assertPredicate("${body[isCredit]} == true", false);
+        assertPredicate("${body[isCredit]} == false", true);
+        assertPredicate("${body['isCredit']} == true", false);
+        assertPredicate("${body['isCredit']} == false", true);
+    }
+
     protected String getLanguageName() {
         return "simple";
     }


Mime
View raw message