CAMEL-9309: Make it easier to turn on|off java transport over http Conflicts: components/camel-ahc/pom.xml
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/23655fe0 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/23655fe0 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/23655fe0 Branch: refs/heads/camel-2.15.x Commit: 23655fe0c15189ca41a6e99c31a3c38001a7cdb0 Parents: 1b1ccbc Author: Claus Ibsen <davscl...@apache.org> Authored: Thu Nov 12 20:41:31 2015 +0100 Committer: Claus Ibsen <davscl...@apache.org> Committed: Thu Nov 12 20:46:38 2015 +0100 ---------------------------------------------------------------------- components/camel-ahc/pom.xml | 5 +++++ .../apache/camel/component/ahc/BaseAhcTest.java | 1 - .../ahc/javabody/AhcProduceJavaBodyTest.java | 20 ++++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/23655fe0/components/camel-ahc/pom.xml ---------------------------------------------------------------------- diff --git a/components/camel-ahc/pom.xml b/components/camel-ahc/pom.xml index b5146e0..c91bac0 100644 --- a/components/camel-ahc/pom.xml +++ b/components/camel-ahc/pom.xml @@ -65,6 +65,11 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-http</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-jetty8</artifactId> <scope>test</scope> </dependency> http://git-wip-us.apache.org/repos/asf/camel/blob/23655fe0/components/camel-ahc/src/test/java/org/apache/camel/component/ahc/BaseAhcTest.java ---------------------------------------------------------------------- diff --git a/components/camel-ahc/src/test/java/org/apache/camel/component/ahc/BaseAhcTest.java b/components/camel-ahc/src/test/java/org/apache/camel/component/ahc/BaseAhcTest.java index 5a68715..6481b05 100644 --- a/components/camel-ahc/src/test/java/org/apache/camel/component/ahc/BaseAhcTest.java +++ b/components/camel-ahc/src/test/java/org/apache/camel/component/ahc/BaseAhcTest.java @@ -131,7 +131,6 @@ public abstract class BaseAhcTest extends CamelTestSupport { } protected String getTestServerEndpointTwoUri() { - return "jetty:" + getTestServerEndpointTwoUrl(); } http://git-wip-us.apache.org/repos/asf/camel/blob/23655fe0/components/camel-ahc/src/test/java/org/apache/camel/component/ahc/javabody/AhcProduceJavaBodyTest.java ---------------------------------------------------------------------- diff --git a/components/camel-ahc/src/test/java/org/apache/camel/component/ahc/javabody/AhcProduceJavaBodyTest.java b/components/camel-ahc/src/test/java/org/apache/camel/component/ahc/javabody/AhcProduceJavaBodyTest.java index 8b3f395..99976c2 100644 --- a/components/camel-ahc/src/test/java/org/apache/camel/component/ahc/javabody/AhcProduceJavaBodyTest.java +++ b/components/camel-ahc/src/test/java/org/apache/camel/component/ahc/javabody/AhcProduceJavaBodyTest.java @@ -22,6 +22,8 @@ import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.ahc.AhcComponent; import org.apache.camel.component.ahc.AhcConstants; import org.apache.camel.component.ahc.BaseAhcTest; +import org.apache.camel.component.http.HttpComponent; +import org.apache.camel.component.jetty.JettyHttpComponent; import org.junit.Test; /** @@ -36,6 +38,9 @@ public class AhcProduceJavaBodyTest extends BaseAhcTest { @Test public void testHttpSendJavaBodyAndReceiveString() throws Exception { + HttpComponent jetty = context.getComponent("jetty", HttpComponent.class); + jetty.setAllowJavaSerializedObject(true); + AhcComponent ahc = context.getComponent("ahc", AhcComponent.class); ahc.setAllowJavaSerializedObject(true); @@ -70,6 +75,9 @@ public class AhcProduceJavaBodyTest extends BaseAhcTest { @Test public void testHttpSendJavaBodyAndReceiveJavaBody() throws Exception { + HttpComponent jetty = context.getComponent("jetty", HttpComponent.class); + jetty.setAllowJavaSerializedObject(true); + AhcComponent ahc = context.getComponent("ahc", AhcComponent.class); ahc.setAllowJavaSerializedObject(true); @@ -105,6 +113,9 @@ public class AhcProduceJavaBodyTest extends BaseAhcTest { @Test public void testHttpSendStringAndReceiveJavaBody() throws Exception { + HttpComponent jetty = context.getComponent("jetty", HttpComponent.class); + jetty.setAllowJavaSerializedObject(true); + AhcComponent ahc = context.getComponent("ahc", AhcComponent.class); ahc.setAllowJavaSerializedObject(true); @@ -135,6 +146,9 @@ public class AhcProduceJavaBodyTest extends BaseAhcTest { @Test public void testNotAllowedReceive() throws Exception { + HttpComponent jetty = context.getComponent("jetty", HttpComponent.class); + jetty.setAllowJavaSerializedObject(true); + AhcComponent ahc = context.getComponent("ahc", AhcComponent.class); ahc.setAllowJavaSerializedObject(false); @@ -163,6 +177,12 @@ public class AhcProduceJavaBodyTest extends BaseAhcTest { @Test public void testNotAllowed() throws Exception { + JettyHttpComponent jetty = context.getComponent("jetty", JettyHttpComponent.class); + jetty.setAllowJavaSerializedObject(false); + + AhcComponent ahc = context.getComponent("ahc", AhcComponent.class); + ahc.setAllowJavaSerializedObject(false); + context.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception {