camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [01/11] camel git commit: Camel catalog - Fixed validator
Date Wed, 06 Jan 2016 10:36:51 GMT
Repository: camel
Updated Branches:
  refs/heads/master 3a26b6128 -> 4c597b887


Camel catalog - Fixed validator


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

Branch: refs/heads/master
Commit: e0a82b80ac38e09505a181928672601df3bfba11
Parents: 3a26b61
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Tue Jan 5 19:26:40 2016 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Wed Jan 6 11:36:25 2016 +0100

----------------------------------------------------------------------
 .../java/org/apache/camel/catalog/DefaultCamelCatalog.java   | 8 ++++++++
 .../test/java/org/apache/camel/catalog/CamelCatalogTest.java | 4 ++++
 2 files changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/e0a82b80/platforms/catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java
----------------------------------------------------------------------
diff --git a/platforms/catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java
b/platforms/catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java
index f04bd3f..5a619bc 100644
--- a/platforms/catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java
+++ b/platforms/catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java
@@ -780,8 +780,16 @@ public class DefaultCamelCatalog implements CamelCatalog {
         }
 
         // validate all the options
+        boolean first = true;
         for (Map.Entry<String, String> property : properties.entrySet()) {
             String value = property.getValue();
+            if (first) {
+                // skip any leading double slash in first property from uri as that is from
the scheme part
+                if (value != null && value.startsWith("//")) {
+                    value = value.substring(2);
+                }
+            }
+            first = false;
 
             String originalName = property.getKey();
             String name = property.getKey();

http://git-wip-us.apache.org/repos/asf/camel/blob/e0a82b80/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java
----------------------------------------------------------------------
diff --git a/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java
b/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java
index b59f872..16627ff 100644
--- a/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java
+++ b/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java
@@ -501,6 +501,10 @@ public class CamelCatalogTest {
         // data format
         result = catalog.validateEndpointProperties("dataformat:string:marshal?charset=utf-8",
true);
         assertTrue(result.isSuccess());
+
+        // 2 slash after component name
+        result = catalog.validateEndpointProperties("atmos://put?remotePath=/dummy.txt");
+        assertTrue(result.isSuccess());
     }
 
     @Test


Mime
View raw message