You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2014/05/15 16:51:39 UTC
git commit: CAMEL-7314 Fixed the test error of camel-jdbc with JDK8
Repository: camel
Updated Branches:
refs/heads/master 415b82e6f -> fc695534c
CAMEL-7314 Fixed the test error of camel-jdbc with JDK8
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/fc695534
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/fc695534
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/fc695534
Branch: refs/heads/master
Commit: fc695534ca1fa1572f961939f38061bdd6159000
Parents: 415b82e
Author: Willem Jiang <wi...@gmail.com>
Authored: Thu May 15 22:51:05 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Thu May 15 22:51:05 2014 +0800
----------------------------------------------------------------------
.../component/jdbc/JdbcParameterizedQueryTest.java | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/fc695534/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcParameterizedQueryTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcParameterizedQueryTest.java b/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcParameterizedQueryTest.java
index 81263b9..099e2e5 100644
--- a/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcParameterizedQueryTest.java
+++ b/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcParameterizedQueryTest.java
@@ -17,7 +17,6 @@
package org.apache.camel.component.jdbc;
import java.util.HashMap;
-import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -32,12 +31,12 @@ public class JdbcParameterizedQueryTest extends AbstractJdbcTestSupport {
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMessageCount(1);
- // must be linked so we can dictate the order
- Map<String, Object> jdbcParams = new LinkedHashMap<String, Object>();
- jdbcParams.put("id", "cust1");
+ // The linkedHashMap values has different order in JDK7 and JDK8
+ // so I had to reduce the parameters size
+ Map<String, Object> jdbcParams = new HashMap<String, Object>();
jdbcParams.put("name", "jstrachan");
- template.sendBodyAndHeaders("direct:start", "select * from customer where id = ? and name = ? order by ID", jdbcParams);
+ template.sendBodyAndHeaders("direct:start", "select * from customer where id = 'cust1' and name = ? order by ID", jdbcParams);
assertMockEndpointsSatisfied();
@@ -53,8 +52,9 @@ public class JdbcParameterizedQueryTest extends AbstractJdbcTestSupport {
mock.expectedMessageCount(1);
Map<String, Object> jdbcParams = new HashMap<String, Object>();
- jdbcParams.put("id", "cust1");
jdbcParams.put("name", "jstrachan");
+ jdbcParams.put("id", "cust1");
+
template.sendBodyAndHeaders("direct:start", "select * from customer where id = :?id and name = :?name order by ID", jdbcParams);