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 CA7CB90CB for ; Sun, 4 Mar 2012 20:19:41 +0000 (UTC) Received: (qmail 45899 invoked by uid 500); 4 Mar 2012 20:19:41 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 45861 invoked by uid 500); 4 Mar 2012 20:19:41 -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 45854 invoked by uid 99); 4 Mar 2012 20:19:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Mar 2012 20:19:41 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Mar 2012 20:19:38 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 64FE423888D2; Sun, 4 Mar 2012 20:19:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1296872 - in /camel/trunk/components/camel-mybatis/src: main/java/org/apache/camel/component/mybatis/ test/java/org/apache/camel/component/mybatis/ Date: Sun, 04 Mar 2012 20:19:17 -0000 To: commits@camel.apache.org From: bvahdat@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120304201917.64FE423888D2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: bvahdat Date: Sun Mar 4 20:19:16 2012 New Revision: 1296872 URL: http://svn.apache.org/viewvc?rev=1296872&view=rev Log: Fixed the failed MyBatisBatchConsumerTest on the CI-Server. Modified: camel/trunk/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisConsumer.java camel/trunk/components/camel-mybatis/src/test/java/org/apache/camel/component/mybatis/MyBatisQueueTest.java camel/trunk/components/camel-mybatis/src/test/java/org/apache/camel/component/mybatis/MyBatisTestSupport.java Modified: camel/trunk/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisConsumer.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisConsumer.java?rev=1296872&r1=1296871&r2=1296872&view=diff ============================================================================== --- camel/trunk/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisConsumer.java (original) +++ camel/trunk/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisConsumer.java Sun Mar 4 20:19:16 2012 @@ -88,7 +88,7 @@ public class MyBatisConsumer extends Sch // poll data from the database MyBatisEndpoint endpoint = getEndpoint(); LOG.trace("Polling: {}", endpoint); - List data = CastUtils.cast(endpoint.getProcessingStrategy().poll(this, getEndpoint())); + List data = endpoint.getProcessingStrategy().poll(this, getEndpoint()); // create a list of exchange objects with the data Queue answer = new LinkedList(); Modified: camel/trunk/components/camel-mybatis/src/test/java/org/apache/camel/component/mybatis/MyBatisQueueTest.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-mybatis/src/test/java/org/apache/camel/component/mybatis/MyBatisQueueTest.java?rev=1296872&r1=1296871&r2=1296872&view=diff ============================================================================== --- camel/trunk/components/camel-mybatis/src/test/java/org/apache/camel/component/mybatis/MyBatisQueueTest.java (original) +++ camel/trunk/components/camel-mybatis/src/test/java/org/apache/camel/component/mybatis/MyBatisQueueTest.java Sun Mar 4 20:19:16 2012 @@ -32,7 +32,7 @@ public class MyBatisQueueTest extends My } protected String createStatement() { - return "create table ACCOUNT ( ACC_ID INTEGER , ACC_FIRST_NAME VARCHAR(255), ACC_LAST_NAME VARCHAR(255), ACC_EMAIL VARCHAR(255), PROCESSED BOOLEAN DEFAULT false)"; + return "create table ACCOUNT (ACC_ID INTEGER, ACC_FIRST_NAME VARCHAR(255), ACC_LAST_NAME VARCHAR(255), ACC_EMAIL VARCHAR(255), PROCESSED BOOLEAN DEFAULT false)"; } @Test Modified: camel/trunk/components/camel-mybatis/src/test/java/org/apache/camel/component/mybatis/MyBatisTestSupport.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-mybatis/src/test/java/org/apache/camel/component/mybatis/MyBatisTestSupport.java?rev=1296872&r1=1296871&r2=1296872&view=diff ============================================================================== --- camel/trunk/components/camel-mybatis/src/test/java/org/apache/camel/component/mybatis/MyBatisTestSupport.java (original) +++ camel/trunk/components/camel-mybatis/src/test/java/org/apache/camel/component/mybatis/MyBatisTestSupport.java Sun Mar 4 20:19:16 2012 @@ -17,12 +17,10 @@ package org.apache.camel.component.mybatis; import java.sql.Connection; -import java.sql.SQLException; import java.sql.Statement; -import java.util.Properties; import org.apache.camel.test.junit4.CamelTestSupport; -import org.apache.derby.jdbc.EmbeddedDriver; + import org.junit.After; import org.junit.Before; @@ -36,7 +34,7 @@ public abstract class MyBatisTestSupport } protected String createStatement() { - return "create table ACCOUNT ( ACC_ID INTEGER , ACC_FIRST_NAME VARCHAR(255), ACC_LAST_NAME VARCHAR(255), ACC_EMAIL VARCHAR(255) )"; + return "create table ACCOUNT (ACC_ID INTEGER, ACC_FIRST_NAME VARCHAR(255), ACC_LAST_NAME VARCHAR(255), ACC_EMAIL VARCHAR(255))"; } @Override @@ -44,11 +42,12 @@ public abstract class MyBatisTestSupport public void setUp() throws Exception { super.setUp(); - // lets create the database... + // lets create the table... Connection connection = createConnection(); Statement statement = connection.createStatement(); statement.execute(createStatement()); connection.commit(); + statement.close(); connection.close(); if (createTestData()) { @@ -71,15 +70,15 @@ public abstract class MyBatisTestSupport @Override @After public void tearDown() throws Exception { + // should drop the table properly to avoid any side effects while running all the tests together under maven + Connection connection = createConnection(); + Statement statement = connection.createStatement(); + statement.execute("drop table ACCOUNT"); + connection.commit(); + statement.close(); + connection.close(); + super.tearDown(); - - try { - new EmbeddedDriver().connect("jdbc:derby:memory:mybatis;drop=true", new Properties()); - } catch (SQLException ex) { - if (!"08006".equals(ex.getSQLState())) { - throw ex; - } - } } private Connection createConnection() throws Exception {