You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2018/08/16 15:26:13 UTC

[camel] branch camel-2.22.x updated (7b9d03e -> 84978c1)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a change to branch camel-2.22.x
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from 7b9d03e  CAMEL-12732 Take into account isAllowManualCommit (#2478)
     new 80e4291  CAMEL-12735 - provide test showing XMlRouteParser doesn't support namespace prefix
     new 3cfc783  CAMEL-12735: Fixed XMlRouteParser to strip namespace prefix so the parser can find endpoints etc.
     new 84978c1  Regen

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 components/readme.adoc                             |  2 +-
 .../camel-spring-boot-dependencies/pom.xml         | 10 +++++
 .../camel/parser/helper/XmlLineNumberParser.java   |  8 +++-
 .../org/apache/camel/parser/xml/XmlRouteTest.java  | 15 ++++++--
 .../parser/xml/mycamel-withNamespacePrefix.xml     | 43 +++++++---------------
 5 files changed, 43 insertions(+), 35 deletions(-)
 copy components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/springTransactionalClientDataSourceUsingTransacted.xml => tooling/camel-route-parser/src/test/resources/org/apache/camel/parser/xml/mycamel-withNamespacePrefix.xml (59%)


[camel] 03/03: Regen

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-2.22.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 84978c119c143a0ffe0839a4ad0cca1a2eaed6e5
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Aug 16 17:25:39 2018 +0200

    Regen
---
 components/readme.adoc                                         |  2 +-
 .../spring-boot-dm/camel-spring-boot-dependencies/pom.xml      | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/components/readme.adoc b/components/readme.adoc
index 176ba70..c0dedef 100644
--- a/components/readme.adoc
+++ b/components/readme.adoc
@@ -540,7 +540,7 @@ Number of Components: 297 in 203 JAR artifacts (20 deprecated)
 `metrics:metricsType:metricsName` | 2.14 | To collect various metrics directly from Camel routes using the DropWizard metrics library.
 
 | link:camel-micrometer/src/main/docs/micrometer-component.adoc[Micrometer] (camel-micrometer) +
-`micrometer:metricsType:meterName` | 2.22 | To collect various metrics directly from Camel routes using the Micrometer library.
+`micrometer:metricsType:metricsName` | 2.22 | To collect various metrics directly from Camel routes using the Micrometer library.
 
 | link:camel-mina/src/main/docs/mina-component.adoc[Mina] (camel-mina) +
 `mina:protocol:host:port` | 1.0 | *deprecated* Socket level networking using TCP or UDP with the Apache Mina 1.x library.
diff --git a/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml b/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml
index 893a268..a8d9efe 100644
--- a/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml
+++ b/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml
@@ -32,6 +32,11 @@
     <dependencies>
       <dependency>
         <groupId>ca.uhn.hapi</groupId>
+        <artifactId>hapi-structures-v21</artifactId>
+        <version>2.3</version>
+      </dependency>
+      <dependency>
+        <groupId>ca.uhn.hapi</groupId>
         <artifactId>hapi-structures-v22</artifactId>
         <version>2.3</version>
       </dependency>
@@ -274,6 +279,11 @@
       </dependency>
       <dependency>
         <groupId>org.apache.camel</groupId>
+        <artifactId>camel-as2</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.camel</groupId>
         <artifactId>camel-asn1</artifactId>
         <version>${project.version}</version>
       </dependency>


[camel] 02/03: CAMEL-12735: Fixed XMlRouteParser to strip namespace prefix so the parser can find endpoints etc.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-2.22.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 3cfc783e542094b28485fe65f4c7bb338e077350
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Aug 16 16:36:07 2018 +0200

    CAMEL-12735: Fixed XMlRouteParser to strip namespace prefix so the parser can find endpoints etc.
---
 .../apache/camel/parser/helper/XmlLineNumberParser.java   |  8 ++++++--
 .../java/org/apache/camel/parser/xml/XmlRouteTest.java    | 15 +++++++--------
 .../camel/parser/xml/mycamel-withNamespacePrefix.xml      |  7 ++++++-
 3 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/tooling/camel-route-parser/src/main/java/org/apache/camel/parser/helper/XmlLineNumberParser.java b/tooling/camel-route-parser/src/main/java/org/apache/camel/parser/helper/XmlLineNumberParser.java
index 35eae1c..407f3df 100644
--- a/tooling/camel-route-parser/src/main/java/org/apache/camel/parser/helper/XmlLineNumberParser.java
+++ b/tooling/camel-route-parser/src/main/java/org/apache/camel/parser/helper/XmlLineNumberParser.java
@@ -125,12 +125,16 @@ public final class XmlLineNumberParser {
                     }
                 }
 
+                // strip namespace prefix
+                int pos = qName.indexOf(':');
+                String lNane = pos > 0 ? qName.substring(pos + 1) : qName;
+
                 if (found) {
                     Element el;
                     if (forceNamespace != null) {
-                        el = doc.createElementNS(forceNamespace, qName);
+                        el = doc.createElementNS(forceNamespace, lNane);
                     } else {
-                        el = doc.createElement(qName);
+                        el = doc.createElement(lNane);
                     }
 
                     for (int i = 0; i < attributes.getLength(); i++) {
diff --git a/tooling/camel-route-parser/src/test/java/org/apache/camel/parser/xml/XmlRouteTest.java b/tooling/camel-route-parser/src/test/java/org/apache/camel/parser/xml/XmlRouteTest.java
index 3f3b853..a388b7f 100644
--- a/tooling/camel-route-parser/src/test/java/org/apache/camel/parser/xml/XmlRouteTest.java
+++ b/tooling/camel-route-parser/src/test/java/org/apache/camel/parser/xml/XmlRouteTest.java
@@ -17,7 +17,6 @@
 package org.apache.camel.parser.xml;
 
 import java.io.FileInputStream;
-import java.io.FileNotFoundException;
 import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.List;
@@ -35,19 +34,19 @@ public class XmlRouteTest {
 
     @Test
     public void testXml() throws Exception {
-    	test("mycamel");
+        test("mycamel");
     }
 
     @Test
     public void testXmlWithNamespacePrefix() throws Exception {
-    	test("mycamel-withNamespacePrefix");
+        test("mycamel-withNamespacePrefix");
     }
-    
-	private void test(String filename) throws FileNotFoundException, Exception {
-		List<CamelEndpointDetails> endpoints = new ArrayList<>();
 
-		InputStream is = new FileInputStream("src/test/resources/org/apache/camel/parser/xml/"+filename+".xml");
-        String fqn = "src/test/resources/org/apache/camel/camel/parser/xml/"+filename+".xml";
+    private void test(String filename) throws Exception {
+        List<CamelEndpointDetails> endpoints = new ArrayList<>();
+
+        InputStream is = new FileInputStream("src/test/resources/org/apache/camel/parser/xml/" + filename + ".xml");
+        String fqn = "src/test/resources/org/apache/camel/camel/parser/xml/" + filename + ".xml";
         String baseDir = "src/test/resources";
         XmlRouteParser.parseXmlRouteEndpoints(is, baseDir, fqn, endpoints);
 
diff --git a/tooling/camel-route-parser/src/test/resources/org/apache/camel/parser/xml/mycamel-withNamespacePrefix.xml b/tooling/camel-route-parser/src/test/resources/org/apache/camel/parser/xml/mycamel-withNamespacePrefix.xml
index 345969c..54479a8 100644
--- a/tooling/camel-route-parser/src/test/resources/org/apache/camel/parser/xml/mycamel-withNamespacePrefix.xml
+++ b/tooling/camel-route-parser/src/test/resources/org/apache/camel/parser/xml/mycamel-withNamespacePrefix.xml
@@ -18,8 +18,13 @@
 
 -->
 <beans xmlns="http://www.springframework.org/schema/beans"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+         http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+         http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
+
     <!-- START SNIPPET: e1 -->
+
     <!-- camelContext is the Camel runtime, where we can host Camel routes -->
     <camel:camelContext id="camelContext-4456db4f-45bb-4aa4-8698-10823e239dbc" xmlns:camel="http://camel.apache.org/schema/spring">
         <camel:route id="myRoute">


[camel] 01/03: CAMEL-12735 - provide test showing XMlRouteParser doesn't support namespace prefix

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-2.22.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 80e429168c75b08df53998c5b2bd2453551898e3
Author: Aurélien Pupier <ap...@redhat.com>
AuthorDate: Thu Aug 16 15:28:12 2018 +0200

    CAMEL-12735 - provide test showing XMlRouteParser doesn't support
    namespace prefix
    
    Signed-off-by: Aurélien Pupier <ap...@redhat.com>
---
 .../org/apache/camel/parser/xml/XmlRouteTest.java  | 18 +++++++---
 .../parser/xml/mycamel-withNamespacePrefix.xml     | 38 ++++++++++++++++++++++
 2 files changed, 52 insertions(+), 4 deletions(-)

diff --git a/tooling/camel-route-parser/src/test/java/org/apache/camel/parser/xml/XmlRouteTest.java b/tooling/camel-route-parser/src/test/java/org/apache/camel/parser/xml/XmlRouteTest.java
index 05be852..3f3b853 100644
--- a/tooling/camel-route-parser/src/test/java/org/apache/camel/parser/xml/XmlRouteTest.java
+++ b/tooling/camel-route-parser/src/test/java/org/apache/camel/parser/xml/XmlRouteTest.java
@@ -17,6 +17,7 @@
 package org.apache.camel.parser.xml;
 
 import java.io.FileInputStream;
+import java.io.FileNotFoundException;
 import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.List;
@@ -34,10 +35,19 @@ public class XmlRouteTest {
 
     @Test
     public void testXml() throws Exception {
-        List<CamelEndpointDetails> endpoints = new ArrayList<>();
+    	test("mycamel");
+    }
 
-        InputStream is = new FileInputStream("src/test/resources/org/apache/camel/parser/xml/mycamel.xml");
-        String fqn = "src/test/resources/org/apache/camel/camel/parser/xml/mycamel.xml";
+    @Test
+    public void testXmlWithNamespacePrefix() throws Exception {
+    	test("mycamel-withNamespacePrefix");
+    }
+    
+	private void test(String filename) throws FileNotFoundException, Exception {
+		List<CamelEndpointDetails> endpoints = new ArrayList<>();
+
+		InputStream is = new FileInputStream("src/test/resources/org/apache/camel/parser/xml/"+filename+".xml");
+        String fqn = "src/test/resources/org/apache/camel/camel/parser/xml/"+filename+".xml";
         String baseDir = "src/test/resources";
         XmlRouteParser.parseXmlRouteEndpoints(is, baseDir, fqn, endpoints);
 
@@ -46,6 +56,6 @@ public class XmlRouteTest {
         }
         Assert.assertEquals("stream:in?promptMessage=Enter something:", endpoints.get(0).getEndpointUri());
         Assert.assertEquals("stream:out", endpoints.get(1).getEndpointUri());
-    }
+	}
 
 }
diff --git a/tooling/camel-route-parser/src/test/resources/org/apache/camel/parser/xml/mycamel-withNamespacePrefix.xml b/tooling/camel-route-parser/src/test/resources/org/apache/camel/parser/xml/mycamel-withNamespacePrefix.xml
new file mode 100644
index 0000000..345969c
--- /dev/null
+++ b/tooling/camel-route-parser/src/test/resources/org/apache/camel/parser/xml/mycamel-withNamespacePrefix.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
+    <!-- START SNIPPET: e1 -->
+    <!-- camelContext is the Camel runtime, where we can host Camel routes -->
+    <camel:camelContext id="camelContext-4456db4f-45bb-4aa4-8698-10823e239dbc" xmlns:camel="http://camel.apache.org/schema/spring">
+        <camel:route id="myRoute">
+            <!-- read input from the console using the stream component -->
+            <!-- transform the input to upper case using the simple language -->
+            <!-- you can also use other languages such as groovy, ognl, mvel, javascript etc. -->
+            <camel:from id="_from1" uri="stream:in?promptMessage=Enter something: "/>
+            <!-- and then print to the console -->
+            <camel:transform id="_transform1">
+                <camel:simple>Hello ${body.toUpperCase()}</camel:simple>
+            </camel:transform>
+            <camel:to id="_to1" uri="stream:out"/>
+        </camel:route>
+    </camel:camelContext>
+    <!-- END SNIPPET: e1 -->
+</beans>