camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/2] camel git commit: CAMEL-10870 - Allow to use negative vendor-specific JDBC types in camel-sql stored procedure
Date Tue, 21 Feb 2017 13:29:47 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.18.x 996bad36b -> fa8aeb34b
  refs/heads/master 507e8b5f8 -> 770e6cabf


CAMEL-10870 - Allow to use negative vendor-specific JDBC types in camel-sql stored procedure


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

Branch: refs/heads/master
Commit: 770e6cabf98da37cbda46aa555aa7d9b568b9868
Parents: 507e8b5
Author: Antoine DESSAIGNE <antoine.dessaigne@gmail.com>
Authored: Tue Feb 21 12:58:26 2017 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Tue Feb 21 14:17:52 2017 +0100

----------------------------------------------------------------------
 .../template/generated/SSPTParserTokenManager.java  |  5 +++--
 .../component/sql/stored/template/grammar/sspt.jj   |  2 +-
 .../camel/component/sql/stored/ParserTest.java      | 16 ++++++++++++++--
 3 files changed, 18 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/770e6cab/components/camel-sql/src/main/java/org/apache/camel/component/sql/stored/template/generated/SSPTParserTokenManager.java
----------------------------------------------------------------------
diff --git a/components/camel-sql/src/main/java/org/apache/camel/component/sql/stored/template/generated/SSPTParserTokenManager.java
b/components/camel-sql/src/main/java/org/apache/camel/component/sql/stored/template/generated/SSPTParserTokenManager.java
index 0432515..d93d9ff 100644
--- a/components/camel-sql/src/main/java/org/apache/camel/component/sql/stored/template/generated/SSPTParserTokenManager.java
+++ b/components/camel-sql/src/main/java/org/apache/camel/component/sql/stored/template/generated/SSPTParserTokenManager.java
@@ -1,5 +1,6 @@
 /* Generated By:JavaCC: Do not edit this line. SSPTParserTokenManager.java */
 package org.apache.camel.component.sql.stored.template.generated;
+import org.apache.camel.component.sql.stored.template.ast.*;
 
 /** Token Manager. */
 public class SSPTParserTokenManager implements SSPTParserConstants
@@ -151,7 +152,7 @@ private int jjMoveNfa_0(int startState, int curPos)
                         kind = 9;
                      jjCheckNAdd(2);
                   }
-                  if ((0x3ff000000000000L & l) != 0L)
+                  if ((0x3ff200000000000L & l) != 0L)
                   {
                      if (kind > 3)
                         kind = 3;
@@ -187,7 +188,7 @@ private int jjMoveNfa_0(int startState, int curPos)
                      jjCheckNAddTwoStates(16, 1);
                   break;
                case 0:
-                  if ((0x3ff000000000000L & l) == 0L)
+                  if ((0x3ff200000000000L & l) == 0L)
                      break;
                   if (kind > 3)
                      kind = 3;

http://git-wip-us.apache.org/repos/asf/camel/blob/770e6cab/components/camel-sql/src/main/java/org/apache/camel/component/sql/stored/template/grammar/sspt.jj
----------------------------------------------------------------------
diff --git a/components/camel-sql/src/main/java/org/apache/camel/component/sql/stored/template/grammar/sspt.jj
b/components/camel-sql/src/main/java/org/apache/camel/component/sql/stored/template/grammar/sspt.jj
index bd3546f..85a2f27 100644
--- a/components/camel-sql/src/main/java/org/apache/camel/component/sql/stored/template/grammar/sspt.jj
+++ b/components/camel-sql/src/main/java/org/apache/camel/component/sql/stored/template/grammar/sspt.jj
@@ -130,7 +130,7 @@ Token InputParameterSrc():
 }
 
 TOKEN: {
-    <NUMBER: (["0"-"9"])+>
+    <NUMBER: (["-","0"-"9"])+>
 }
 
 TOKEN: {

http://git-wip-us.apache.org/repos/asf/camel/blob/770e6cab/components/camel-sql/src/test/java/org/apache/camel/component/sql/stored/ParserTest.java
----------------------------------------------------------------------
diff --git a/components/camel-sql/src/test/java/org/apache/camel/component/sql/stored/ParserTest.java
b/components/camel-sql/src/test/java/org/apache/camel/component/sql/stored/ParserTest.java
index cc399be..2534aed 100644
--- a/components/camel-sql/src/test/java/org/apache/camel/component/sql/stored/ParserTest.java
+++ b/components/camel-sql/src/test/java/org/apache/camel/component/sql/stored/ParserTest.java
@@ -93,17 +93,29 @@ public class ParserTest extends CamelTestSupport {
     }
 
     @Test
-    public void vendorSpeficSqlType() {
+    public void vendorSpecificPositiveSqlType() {
         Template template = parser.parseTemplate("ADDNUMBERS2(1342 ${header.foo})");
         assertEquals(1342, ((InputParameter) template.getParameterList().get(0)).getSqlType());
     }
 
     @Test
-    public void vendorSpeficSqlTypeOut() {
+    public void vendorSpecificNegativeSqlType() {
+        Template template = parser.parseTemplate("ADDNUMBERS2(-1342 ${header.foo})");
+        assertEquals(-1342, ((InputParameter) template.getParameterList().get(0)).getSqlType());
+    }
+
+    @Test
+    public void vendorSpecificPositiveSqlTypeOut() {
         Template template = parser.parseTemplate("ADDNUMBERS2(OUT 1342 h1)");
         assertEquals(1342, ((OutParameter) template.getParameterList().get(0)).getSqlType());
     }
 
+    @Test
+    public void vendorSpecificNegativeSqlTypeOut() {
+        Template template = parser.parseTemplate("ADDNUMBERS2(OUT -1342 h1)");
+        assertEquals(-1342, ((OutParameter) template.getParameterList().get(0)).getSqlType());
+    }
+
 
     @Test
     public void nableIssueSyntax() {


Mime
View raw message