camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [01/10] camel git commit: CAMEL-9491 : statement.maxRows not working as expected camel jdbc
Date Fri, 08 Jan 2016 16:40:56 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.15.x 5ee90c1aa -> e36c7bfcb
  refs/heads/camel-2.16.x 110f4001d -> 9311f8254
  refs/heads/master 7253ae98f -> dbd5c5b13


CAMEL-9491 : statement.maxRows not working as expected camel jdbc 


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

Branch: refs/heads/master
Commit: 6778aa26187863be617b96fa67a195241097ae3d
Parents: 5ff0eb1
Author: gautric <gautric@redhat.com>
Authored: Fri Jan 8 16:36:44 2016 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Fri Jan 8 17:38:32 2016 +0100

----------------------------------------------------------------------
 .../camel/component/jdbc/JdbcFix9491Test.java   | 61 ++++++++++++++++++++
 1 file changed, 61 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/6778aa26/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcFix9491Test.java
----------------------------------------------------------------------
diff --git a/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcFix9491Test.java
b/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcFix9491Test.java
new file mode 100644
index 0000000..32928bf
--- /dev/null
+++ b/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcFix9491Test.java
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.jdbc;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Unit test based on user forum request about this component
+ */
+public class JdbcFix9491Test extends AbstractJdbcTestSupport {
+
+    @EndpointInject(uri = "mock:result")
+    private MockEndpoint mock;
+
+    @EndpointInject(uri = "direct:start")
+    private ProducerTemplate direct;
+
+    @Test
+    public void testTimerInvoked() throws Exception {
+        mock.expectedMessageCount(2);
+
+        direct.sendBody("select * from customer");
+        direct.sendBody("select * from customer");
+
+        assertMockEndpointsSatisfied();
+        Assert.assertEquals(3,mock.getReceivedExchanges().get(1).getIn().getBody(List.class).size());
+
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            public void configure() throws Exception {
+                from("direct:start").
+                to("jdbc:testdb").to("mock:result");
+            }
+        };
+    }
+}


Mime
View raw message