camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r991199 - in /camel/trunk/components/camel-jdbc/src: main/java/org/apache/camel/component/jdbc/ test/java/org/apache/camel/component/jdbc/
Date Tue, 31 Aug 2010 14:11:01 GMT
Author: davsclaus
Date: Tue Aug 31 14:11:00 2010
New Revision: 991199

URL: http://svn.apache.org/viewvc?rev=991199&view=rev
Log:
Fixed test on other boxes.

Modified:
    camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java
    camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcPreserveHeadersTest.java
    camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcRouteUsingSqlSelectAliasJdbc3Test.java

Modified: camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java?rev=991199&r1=991198&r2=991199&view=diff
==============================================================================
--- camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java
(original)
+++ camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java
Tue Aug 31 14:11:00 2010
@@ -74,9 +74,6 @@ public class JdbcProducer extends Defaul
                 LOG.debug("Executing JDBC statement: " + sql);
             }
 
-            // preserve headers, but allow overwriting
-            exchange.getOut().setHeaders(exchange.getIn().getHeaders());
-
             if (stmt.execute(sql)) {
                 rs = stmt.getResultSet();
                 setResultSet(exchange, rs);
@@ -99,6 +96,9 @@ public class JdbcProducer extends Defaul
                 LOG.warn("Error closing JDBC resource: " + e, e);
             }
         }
+
+        // preserve headers
+        exchange.getOut().setHeaders(exchange.getIn().getHeaders());
     }
 
     /**

Modified: camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcPreserveHeadersTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcPreserveHeadersTest.java?rev=991199&r1=991198&r2=991199&view=diff
==============================================================================
--- camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcPreserveHeadersTest.java
(original)
+++ camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcPreserveHeadersTest.java
Tue Aug 31 14:11:00 2010
@@ -42,10 +42,6 @@ public class JdbcPreserveHeadersTest ext
 
     @Test
     public void testPreserveHeaders() throws Exception {
-        // windows may fail this test
-        if (isPlatform("windows")) {
-            return;
-        }
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedMessageCount(1);
         mock.expectedHeaderReceived("foo", "bar");
@@ -67,7 +63,7 @@ public class JdbcPreserveHeadersTest ext
                                 e.getIn().setHeader("foo", "bar");
                             }
                         }).
-                        setBody(constant("select * from customer")).
+                        setBody(constant("select name from customer where id = 'cust1'")).
                         to("jdbc:testdb").
                         to("mock:result");
             }

Modified: camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcRouteUsingSqlSelectAliasJdbc3Test.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcRouteUsingSqlSelectAliasJdbc3Test.java?rev=991199&r1=991198&r2=991199&view=diff
==============================================================================
--- camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcRouteUsingSqlSelectAliasJdbc3Test.java
(original)
+++ camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcRouteUsingSqlSelectAliasJdbc3Test.java
Tue Aug 31 14:11:00 2010
@@ -26,7 +26,7 @@ public class JdbcRouteUsingSqlSelectAlia
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() throws Exception {
-                from("direct:hello").to("jdbc:testdb?readSize=100?useJDBC4ColumnNameAndLabelSemantics=false");
+                from("direct:hello").to("jdbc:testdb?readSize=100&useJDBC4ColumnNameAndLabelSemantics=false");
             }
         };
     }



Mime
View raw message