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 2016/01/08 13:44:08 UTC

[1/4] camel git commit: CAMEL-9492: camel-netty-http - The http/https protocol should be mandatory

Repository: camel
Updated Branches:
  refs/heads/camel-2.16.x 2a7e275ed -> 8466cc245
  refs/heads/master b8b8c4d93 -> 6a9c07cad


CAMEL-9492: camel-netty-http - The http/https protocol should be mandatory


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

Branch: refs/heads/master
Commit: e5b6e370c112e10f60e3b60f10791761ca0ede1d
Parents: b8b8c4d
Author: Claus Ibsen <da...@apache.org>
Authored: Fri Jan 8 13:23:59 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Jan 8 13:23:59 2016 +0100

----------------------------------------------------------------------
 .../camel/component/netty/http/NettyHttpConfiguration.java      | 2 +-
 .../camel/component/netty/http/NettyDefaultProtocolTest.java    | 2 +-
 .../camel/component/netty4/http/NettyHttpConfiguration.java     | 2 +-
 .../camel/component/netty4/http/NettyDefaultProtocolTest.java   | 2 +-
 .../test/java/org/apache/camel/catalog/CamelCatalogTest.java    | 5 +++--
 5 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/e5b6e370/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
index ed9638b..641f16f 100644
--- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
+++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
@@ -34,7 +34,7 @@ import org.jboss.netty.handler.codec.frame.TooLongFrameException;
 @UriParams
 public class NettyHttpConfiguration extends NettyConfiguration {
 
-    @UriPath(enums = "http,https", defaultValue = "http") @Metadata(required = "true")
+    @UriPath(enums = "http,https") @Metadata(required = "true")
     private String protocol;
     @UriPath @Metadata(required = "true")
     private String host;

http://git-wip-us.apache.org/repos/asf/camel/blob/e5b6e370/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyDefaultProtocolTest.java
----------------------------------------------------------------------
diff --git a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyDefaultProtocolTest.java b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyDefaultProtocolTest.java
index 4160538..07952dd 100644
--- a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyDefaultProtocolTest.java
+++ b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyDefaultProtocolTest.java
@@ -44,7 +44,7 @@ public class NettyDefaultProtocolTest extends BaseNettyTest {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("netty-http:0.0.0.0:{{port}}/foo")
+                from("netty-http:http:0.0.0.0:{{port}}/foo")
                     .to("mock:input")
                     .transform().constant("Bye World");
             }

http://git-wip-us.apache.org/repos/asf/camel/blob/e5b6e370/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
index 74c6f28..d9bbbbb 100644
--- a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
+++ b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
@@ -33,7 +33,7 @@ import org.apache.camel.spi.UriPath;
 @UriParams
 public class NettyHttpConfiguration extends NettyConfiguration {
 
-    @UriPath(enums = "http,https", defaultValue = "http") @Metadata(required = "true")
+    @UriPath(enums = "http,https") @Metadata(required = "true")
     private String protocol;
     @UriPath @Metadata(required = "true")
     private String host;

http://git-wip-us.apache.org/repos/asf/camel/blob/e5b6e370/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyDefaultProtocolTest.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyDefaultProtocolTest.java b/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyDefaultProtocolTest.java
index af1aa8a..d35eb7f 100644
--- a/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyDefaultProtocolTest.java
+++ b/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyDefaultProtocolTest.java
@@ -44,7 +44,7 @@ public class NettyDefaultProtocolTest extends BaseNettyTest {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("netty4-http:0.0.0.0:{{port}}/foo")
+                from("netty4-http:http:0.0.0.0:{{port}}/foo")
                         .to("mock:input")
                         .transform().constant("Bye World");
             }

http://git-wip-us.apache.org/repos/asf/camel/blob/e5b6e370/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 8132107..275d5c2 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
@@ -164,7 +164,8 @@ public class CamelCatalogTest {
     @Test
     public void testAsEndpointUriNetty4http() throws Exception {
         Map<String, String> map = new HashMap<String, String>();
-        // use default protocol
+        // use http protocol
+        map.put("protocol", "http");
         map.put("host", "localhost");
         map.put("port", "8080");
         map.put("path", "foo/bar");
@@ -173,7 +174,7 @@ public class CamelCatalogTest {
         String uri = catalog.asEndpointUri("netty4-http", map, true);
         assertEquals("netty4-http:http:localhost:8080/foo/bar?disconnect=true", uri);
 
-        // lets add a protocol
+        // lets switch protocol
         map.put("protocol", "https");
 
         uri = catalog.asEndpointUri("netty4-http", map, true);


[4/4] camel git commit: Camel catalog - Fixed endpoint properties parser.

Posted by da...@apache.org.
Camel catalog - Fixed endpoint properties parser.


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

Branch: refs/heads/camel-2.16.x
Commit: 8466cc24511ed117934cdd0cef96d3e1c6990eec
Parents: 245e14e
Author: Claus Ibsen <da...@apache.org>
Authored: Fri Jan 8 13:35:47 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Jan 8 13:43:58 2016 +0100

----------------------------------------------------------------------
 .../component/netty/http/NettyHttpConfiguration.java   |  2 +-
 .../component/netty4/http/NettyHttpConfiguration.java  |  2 +-
 .../org/apache/camel/catalog/DefaultCamelCatalog.java  | 13 ++++++++++++-
 3 files changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/8466cc24/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
index 641f16f..05999d3 100644
--- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
+++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
@@ -40,7 +40,7 @@ public class NettyHttpConfiguration extends NettyConfiguration {
     private String host;
     @UriPath
     private int port;
-    @UriPath @Metadata(required = "true")
+    @UriPath
     private String path;
     @UriParam(label = "consumer,advanced")
     private boolean urlDecodeHeaders;

http://git-wip-us.apache.org/repos/asf/camel/blob/8466cc24/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
index d9bbbbb..9f6c9bb 100644
--- a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
+++ b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
@@ -39,7 +39,7 @@ public class NettyHttpConfiguration extends NettyConfiguration {
     private String host;
     @UriPath
     private int port;
-    @UriPath @Metadata(required = "true")
+    @UriPath
     private String path;
     @UriParam(label = "consumer,advanced")
     private boolean urlDecodeHeaders;

http://git-wip-us.apache.org/repos/asf/camel/blob/8466cc24/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 14a4d50..ae955d6 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
@@ -1102,7 +1102,18 @@ public class DefaultCamelCatalog implements CamelCatalog {
             } else {
                 // we have a little problem as we do not not have all options
                 if (!required) {
-                    String value = defaultValue;
+                    String value = null;
+
+                    boolean last = i == word.size() - 1;
+                    if (last) {
+                        // if its the last value then use it instead of the default value
+                        value = it.hasNext() ? it.next() : null;
+                        if (value != null) {
+                            options.put(key, value);
+                        } else {
+                            value = defaultValue;
+                        }
+                    }
                     if (value != null) {
                         options.put(key, value);
                         defaultValueAdded = true;


[2/4] camel git commit: Camel catalog - Fixed endpoint properties parser.

Posted by da...@apache.org.
Camel catalog - Fixed endpoint properties parser.


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

Branch: refs/heads/master
Commit: 6a9c07cad2c9fa7a0148b7405778beaf2af3d1a5
Parents: e5b6e37
Author: Claus Ibsen <da...@apache.org>
Authored: Fri Jan 8 13:35:47 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Jan 8 13:35:47 2016 +0100

----------------------------------------------------------------------
 .../component/netty/http/NettyHttpConfiguration.java   |  2 +-
 .../component/netty4/http/NettyHttpConfiguration.java  |  2 +-
 .../org/apache/camel/catalog/DefaultCamelCatalog.java  | 13 ++++++++++++-
 3 files changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/6a9c07ca/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
index 641f16f..05999d3 100644
--- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
+++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
@@ -40,7 +40,7 @@ public class NettyHttpConfiguration extends NettyConfiguration {
     private String host;
     @UriPath
     private int port;
-    @UriPath @Metadata(required = "true")
+    @UriPath
     private String path;
     @UriParam(label = "consumer,advanced")
     private boolean urlDecodeHeaders;

http://git-wip-us.apache.org/repos/asf/camel/blob/6a9c07ca/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
index d9bbbbb..9f6c9bb 100644
--- a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
+++ b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
@@ -39,7 +39,7 @@ public class NettyHttpConfiguration extends NettyConfiguration {
     private String host;
     @UriPath
     private int port;
-    @UriPath @Metadata(required = "true")
+    @UriPath
     private String path;
     @UriParam(label = "consumer,advanced")
     private boolean urlDecodeHeaders;

http://git-wip-us.apache.org/repos/asf/camel/blob/6a9c07ca/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 14a4d50..ae955d6 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
@@ -1102,7 +1102,18 @@ public class DefaultCamelCatalog implements CamelCatalog {
             } else {
                 // we have a little problem as we do not not have all options
                 if (!required) {
-                    String value = defaultValue;
+                    String value = null;
+
+                    boolean last = i == word.size() - 1;
+                    if (last) {
+                        // if its the last value then use it instead of the default value
+                        value = it.hasNext() ? it.next() : null;
+                        if (value != null) {
+                            options.put(key, value);
+                        } else {
+                            value = defaultValue;
+                        }
+                    }
                     if (value != null) {
                         options.put(key, value);
                         defaultValueAdded = true;


[3/4] camel git commit: CAMEL-9492: camel-netty-http - The http/https protocol should be mandatory

Posted by da...@apache.org.
CAMEL-9492: camel-netty-http - The http/https protocol should be mandatory


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

Branch: refs/heads/camel-2.16.x
Commit: 245e14ea6e32712fb8c4f5d1b536f7e26cd6a71f
Parents: 2a7e275
Author: Claus Ibsen <da...@apache.org>
Authored: Fri Jan 8 13:23:59 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Jan 8 13:43:51 2016 +0100

----------------------------------------------------------------------
 .../camel/component/netty/http/NettyHttpConfiguration.java      | 2 +-
 .../camel/component/netty/http/NettyDefaultProtocolTest.java    | 2 +-
 .../camel/component/netty4/http/NettyHttpConfiguration.java     | 2 +-
 .../camel/component/netty4/http/NettyDefaultProtocolTest.java   | 2 +-
 .../test/java/org/apache/camel/catalog/CamelCatalogTest.java    | 5 +++--
 5 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/245e14ea/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
index ed9638b..641f16f 100644
--- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
+++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
@@ -34,7 +34,7 @@ import org.jboss.netty.handler.codec.frame.TooLongFrameException;
 @UriParams
 public class NettyHttpConfiguration extends NettyConfiguration {
 
-    @UriPath(enums = "http,https", defaultValue = "http") @Metadata(required = "true")
+    @UriPath(enums = "http,https") @Metadata(required = "true")
     private String protocol;
     @UriPath @Metadata(required = "true")
     private String host;

http://git-wip-us.apache.org/repos/asf/camel/blob/245e14ea/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyDefaultProtocolTest.java
----------------------------------------------------------------------
diff --git a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyDefaultProtocolTest.java b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyDefaultProtocolTest.java
index 4160538..07952dd 100644
--- a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyDefaultProtocolTest.java
+++ b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyDefaultProtocolTest.java
@@ -44,7 +44,7 @@ public class NettyDefaultProtocolTest extends BaseNettyTest {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("netty-http:0.0.0.0:{{port}}/foo")
+                from("netty-http:http:0.0.0.0:{{port}}/foo")
                     .to("mock:input")
                     .transform().constant("Bye World");
             }

http://git-wip-us.apache.org/repos/asf/camel/blob/245e14ea/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
index 74c6f28..d9bbbbb 100644
--- a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
+++ b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpConfiguration.java
@@ -33,7 +33,7 @@ import org.apache.camel.spi.UriPath;
 @UriParams
 public class NettyHttpConfiguration extends NettyConfiguration {
 
-    @UriPath(enums = "http,https", defaultValue = "http") @Metadata(required = "true")
+    @UriPath(enums = "http,https") @Metadata(required = "true")
     private String protocol;
     @UriPath @Metadata(required = "true")
     private String host;

http://git-wip-us.apache.org/repos/asf/camel/blob/245e14ea/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyDefaultProtocolTest.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyDefaultProtocolTest.java b/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyDefaultProtocolTest.java
index af1aa8a..d35eb7f 100644
--- a/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyDefaultProtocolTest.java
+++ b/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyDefaultProtocolTest.java
@@ -44,7 +44,7 @@ public class NettyDefaultProtocolTest extends BaseNettyTest {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("netty4-http:0.0.0.0:{{port}}/foo")
+                from("netty4-http:http:0.0.0.0:{{port}}/foo")
                         .to("mock:input")
                         .transform().constant("Bye World");
             }

http://git-wip-us.apache.org/repos/asf/camel/blob/245e14ea/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 8132107..275d5c2 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
@@ -164,7 +164,8 @@ public class CamelCatalogTest {
     @Test
     public void testAsEndpointUriNetty4http() throws Exception {
         Map<String, String> map = new HashMap<String, String>();
-        // use default protocol
+        // use http protocol
+        map.put("protocol", "http");
         map.put("host", "localhost");
         map.put("port", "8080");
         map.put("path", "foo/bar");
@@ -173,7 +174,7 @@ public class CamelCatalogTest {
         String uri = catalog.asEndpointUri("netty4-http", map, true);
         assertEquals("netty4-http:http:localhost:8080/foo/bar?disconnect=true", uri);
 
-        // lets add a protocol
+        // lets switch protocol
         map.put("protocol", "https");
 
         uri = catalog.asEndpointUri("netty4-http", map, true);