Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B9014187B9 for ; Fri, 8 Jan 2016 16:40:56 +0000 (UTC) Received: (qmail 59178 invoked by uid 500); 8 Jan 2016 16:40:56 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 59038 invoked by uid 500); 8 Jan 2016 16:40:56 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 59007 invoked by uid 99); 8 Jan 2016 16:40:56 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jan 2016 16:40:56 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 668C7E000F; Fri, 8 Jan 2016 16:40:56 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: davsclaus@apache.org To: commits@camel.apache.org Date: Fri, 08 Jan 2016 16:40:56 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [01/10] camel git commit: CAMEL-9491 : statement.maxRows not working as expected camel jdbc 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 Authored: Fri Jan 8 16:36:44 2016 +0100 Committer: Claus Ibsen 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"); + } + }; + } +}