Skip to content

Commit

Permalink
CAMEL-9309: Make it easier to turn on|off java transport over http
Browse files Browse the repository at this point in the history
  • Loading branch information
davsclaus committed Nov 12, 2015
1 parent 0afcf72 commit 5ea0a6f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/camel-ahc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jetty</artifactId>
<artifactId>camel-jetty9</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ protected String getTestServerEndpointTwoUrl() {
}

protected String getTestServerEndpointTwoUri() {

return "jetty:" + getTestServerEndpointTwoUrl();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
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.jetty.JettyHttpComponent;
import org.apache.camel.http.common.HttpCommonComponent;
import org.junit.Test;

/**
Expand All @@ -36,6 +38,9 @@ public boolean isUseRouteBuilder() {

@Test
public void testHttpSendJavaBodyAndReceiveString() throws Exception {
HttpCommonComponent jetty = context.getComponent("jetty", HttpCommonComponent.class);
jetty.setAllowJavaSerializedObject(true);

AhcComponent ahc = context.getComponent("ahc", AhcComponent.class);
ahc.setAllowJavaSerializedObject(true);

Expand Down Expand Up @@ -70,6 +75,9 @@ public void process(Exchange exchange) throws Exception {

@Test
public void testHttpSendJavaBodyAndReceiveJavaBody() throws Exception {
HttpCommonComponent jetty = context.getComponent("jetty", HttpCommonComponent.class);
jetty.setAllowJavaSerializedObject(true);

AhcComponent ahc = context.getComponent("ahc", AhcComponent.class);
ahc.setAllowJavaSerializedObject(true);

Expand Down Expand Up @@ -105,6 +113,9 @@ public void process(Exchange exchange) throws Exception {

@Test
public void testHttpSendStringAndReceiveJavaBody() throws Exception {
HttpCommonComponent jetty = context.getComponent("jetty", HttpCommonComponent.class);
jetty.setAllowJavaSerializedObject(true);

AhcComponent ahc = context.getComponent("ahc", AhcComponent.class);
ahc.setAllowJavaSerializedObject(true);

Expand Down Expand Up @@ -135,6 +146,9 @@ public void process(Exchange exchange) throws Exception {

@Test
public void testNotAllowedReceive() throws Exception {
HttpCommonComponent jetty = context.getComponent("jetty", HttpCommonComponent.class);
jetty.setAllowJavaSerializedObject(true);

AhcComponent ahc = context.getComponent("ahc", AhcComponent.class);
ahc.setAllowJavaSerializedObject(false);

Expand Down Expand Up @@ -163,6 +177,12 @@ public void process(Exchange exchange) throws Exception {

@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 {
Expand Down

0 comments on commit 5ea0a6f

Please sign in to comment.