Updated Branches: refs/heads/master 0d4357174 -> a30c165fb
CAMEL-6327: More work on new camel-netty-http component. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a30c165f Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a30c165f Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a30c165f Branch: refs/heads/master Commit: a30c165fbdb012a2c2b28351291b99a35e950f6a Parents: 0d43571 Author: Claus Ibsen <davscl...@apache.org> Authored: Wed Jun 19 12:25:26 2013 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Wed Jun 19 12:25:26 2013 +0200 ---------------------------------------------------------------------- ...outesValidateBootstrapConfigurationTest.java | 6 +++--- .../NettyServerBootstrapConfiguration.java | 20 ++++++++++++++++++-- 2 files changed, 21 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/a30c165f/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpTwoRoutesValidateBootstrapConfigurationTest.java ---------------------------------------------------------------------- diff --git a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpTwoRoutesValidateBootstrapConfigurationTest.java b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpTwoRoutesValidateBootstrapConfigurationTest.java index 77813cb..abd7d08 100644 --- a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpTwoRoutesValidateBootstrapConfigurationTest.java +++ b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpTwoRoutesValidateBootstrapConfigurationTest.java @@ -31,12 +31,12 @@ public class NettyHttpTwoRoutesValidateBootstrapConfigurationTest extends BaseNe context.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { - from("netty-http:http://0.0.0.0:{{port}}/foo") + from("netty-http:http://0.0.0.0:{{port}}/foo?option.child.keepAlive=false") .to("mock:foo") .transform().constant("Bye World"); - // we cannot have a 2nd route on same port with SSL enabled, when the 1st route is NOT - from("netty-http:http://0.0.0.0:{{port}}/bar?ssl=true") + // we cannot have a 2nd route on same port with different option that the 1st route + from("netty-http:http://0.0.0.0:{{port}}/bar?option.child.keepAlive=true") .to("mock:bar") .transform().constant("Bye Camel"); } http://git-wip-us.apache.org/repos/asf/camel/blob/a30c165f/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyServerBootstrapConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyServerBootstrapConfiguration.java b/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyServerBootstrapConfiguration.java index 7542e8e..6992874 100644 --- a/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyServerBootstrapConfiguration.java +++ b/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyServerBootstrapConfiguration.java @@ -325,8 +325,24 @@ public class NettyServerBootstrapConfiguration implements Cloneable { if (nettyServerBootstrapFactory != other.nettyServerBootstrapFactory) { return false; } - // TODO: compare all the options - + // validate all the options is identical + if (options == null && other.options != null) { + return false; + } + if (options != null && other.options == null) { + return false; + } + if (options != null && other.options != null) { + if (options.size() != other.options.size()) { + return false; + } + if (!options.keySet().containsAll(other.options.keySet())) { + return false; + } + if (!options.values().containsAll(other.options.values())) { + return false; + } + } if (ssl != other.ssl) { return false; }