camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [13/14] camel git commit: Camel catalog - Add api to validate endpoint uri
Date Wed, 23 Dec 2015 08:44:06 GMT
Camel catalog - Add api to validate endpoint uri


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

Branch: refs/heads/camel-2.16.x
Commit: 535055be79f3c73b352e534f263fb8bb13a602a2
Parents: 89e9089
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Tue Dec 22 10:41:49 2015 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Wed Dec 23 09:43:33 2015 +0100

----------------------------------------------------------------------
 .../java/org/apache/camel/catalog/EndpointValidationResult.java | 4 ++++
 .../test/java/org/apache/camel/catalog/CamelCatalogTest.java    | 5 +++++
 2 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/535055be/platforms/catalog/src/main/java/org/apache/camel/catalog/EndpointValidationResult.java
----------------------------------------------------------------------
diff --git a/platforms/catalog/src/main/java/org/apache/camel/catalog/EndpointValidationResult.java
b/platforms/catalog/src/main/java/org/apache/camel/catalog/EndpointValidationResult.java
index af97eb7..ece32b6 100644
--- a/platforms/catalog/src/main/java/org/apache/camel/catalog/EndpointValidationResult.java
+++ b/platforms/catalog/src/main/java/org/apache/camel/catalog/EndpointValidationResult.java
@@ -48,6 +48,10 @@ public class EndpointValidationResult implements Serializable {
         this.uri = uri;
     }
 
+    public String getUri() {
+        return uri;
+    }
+
     public boolean isSuccess() {
         boolean ok = syntaxError == null && unknownComponent == null
                 && unknown == null && required == null;

http://git-wip-us.apache.org/repos/asf/camel/blob/535055be/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 162b09b..b2fb872 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
@@ -441,6 +441,11 @@ public class CamelCatalogTest {
         result = catalog.validateEndpointProperties("foo:bar?me=you");
         assertFalse(result.isSuccess());
         assertTrue(result.getUnknownComponent().equals("foo"));
+
+        // invalid boolean but default value
+        result = catalog.validateEndpointProperties("log:output?showAll=ggg");
+        assertFalse(result.isSuccess());
+        assertEquals("ggg", result.getInvalidBoolean().get("showAll"));
     }
 
     @Test


Mime
View raw message