Updated Branches: refs/heads/camel-2.11.x b5439f06d -> 6869741e1 refs/heads/master ab6074a0e -> 682d068b1
CAMEL-6327: camel-netty-http - Working on CBR with xpath issue. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/682d068b Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/682d068b Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/682d068b Branch: refs/heads/master Commit: 682d068b19d981200dafe83030a5291400ea766f Parents: ab6074a Author: Claus Ibsen <[email protected]> Authored: Thu Jun 27 16:09:29 2013 +0200 Committer: Claus Ibsen <[email protected]> Committed: Thu Jun 27 16:09:29 2013 +0200 ---------------------------------------------------------------------- .../camel/component/netty/http/NettyHttpXMLXPathTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/682d068b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpXMLXPathTest.java ---------------------------------------------------------------------- diff --git a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpXMLXPathTest.java b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpXMLXPathTest.java index 6fdfd2e..4d433e5 100644 --- a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpXMLXPathTest.java +++ b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpXMLXPathTest.java @@ -31,6 +31,12 @@ public class NettyHttpXMLXPathTest extends BaseNettyTest { public void testHttpXML() throws Exception { String out = template.requestBody("netty-http:http://localhost:{{port}}/foo", "<person><name>Claus</name></person>", String.class); assertEquals("<quote>Camel rocks</quote>", out); + + out = template.requestBody("netty-http:http://localhost:{{port}}/foo", "<person><name>James</name></person>", String.class); + assertEquals("<quote>Camel really rocks</quote>", out); + + out = template.requestBody("netty-http:http://localhost:{{port}}/foo", "<person><name>Jonathan</name></person>", String.class); + assertEquals("<quote>Try Camel now</quote>", out); } @Override @@ -39,9 +45,13 @@ public class NettyHttpXMLXPathTest extends BaseNettyTest { @Override public void configure() throws Exception { from("netty-http:http://0.0.0.0:{{port}}/foo") + // need to convert to byte[] to have the CBR with xpath working + .convertBodyTo(byte[].class) .choice() .when().xpath("/person/name = 'Claus'") .transform(constant("<quote>Camel rocks</quote>")) + .when().xpath("/person/name = 'James'") + .transform(constant("<quote>Camel really rocks</quote>")) .otherwise() .transform(constant("<quote>Try Camel now</quote>")); }
