Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 04E4A18989 for ; Wed, 23 Dec 2015 08:43:55 +0000 (UTC) Received: (qmail 76023 invoked by uid 500); 23 Dec 2015 08:43:54 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 75916 invoked by uid 500); 23 Dec 2015 08:43:54 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 75586 invoked by uid 99); 23 Dec 2015 08:43:54 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Dec 2015 08:43:54 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7FE2FE0B2B; Wed, 23 Dec 2015 08:43:54 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: davsclaus@apache.org To: commits@camel.apache.org Date: Wed, 23 Dec 2015 08:44:06 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [13/14] camel git commit: Camel catalog - Add api to validate endpoint uri 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 Authored: Tue Dec 22 10:41:49 2015 +0100 Committer: Claus Ibsen 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