Repository: camel Updated Branches: refs/heads/master c5254616b -> 0b4a1675d
CAMEL-8774 Remove the System.out.println Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/660ebaaf Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/660ebaaf Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/660ebaaf Branch: refs/heads/master Commit: 660ebaaf95efaf1b21b9a36616739be5c1e7cc98 Parents: c525461 Author: Willem Jiang <[email protected]> Authored: Sun May 31 16:58:01 2015 +0800 Committer: Willem Jiang <[email protected]> Committed: Sun May 31 16:58:01 2015 +0800 ---------------------------------------------------------------------- .../org/apache/camel/component/http4/HttpProducer.java | 13 ++++++------- .../camel/component/http4/HttpCompressionTest.java | 13 ++++++------- 2 files changed, 12 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/660ebaaf/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java ---------------------------------------------------------------------- diff --git a/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java index a301f54..612c6ce 100644 --- a/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java +++ b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java @@ -67,7 +67,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * @version + * @version */ public class HttpProducer extends DefaultProducer { private static final Logger LOG = LoggerFactory.getLogger(HttpProducer.class); @@ -102,7 +102,7 @@ public class HttpProducer extends DefaultProducer { if (queryString != null) { skipRequestHeaders = URISupport.parseQuery(queryString, false, true); } - // Need to remove the Host key as it should be not used + // Need to remove the Host key as it should be not used exchange.getIn().getHeaders().remove("host"); } HttpRequestBase httpRequest = createMethod(exchange); @@ -194,7 +194,6 @@ public class HttpProducer extends DefaultProducer { // propagate HTTP response headers Header[] headers = httpResponse.getAllHeaders(); for (Header header : headers) { - System.out.println("headers name " + header.getName()); String name = header.getName(); String value = header.getValue(); if (name.toLowerCase().equals("content-type")) { @@ -210,7 +209,7 @@ public class HttpProducer extends DefaultProducer { // preserve headers from in by copying any non existing headers // to avoid overriding existing headers with old values - // Just filter the http protocol headers + // Just filter the http protocol headers MessageHelper.copyHeaders(exchange.getIn(), answer, httpProtocolHeaderFilterStrategy, false); } @@ -411,19 +410,19 @@ public class HttpProducer extends DefaultProducer { if (data != null) { String contentTypeString = ExchangeHelper.getContentType(exchange); ContentType contentType = null; - + //Check the contentType is valid or not, If not it throws an exception. //When ContentType.parse parse method parse "multipart/form-data;boundary=---------------------------j2radvtrk", //it removes "boundary" from Content-Type; I have to use contentType.create method. if (contentTypeString != null) { - // using ContentType.parser for charset + // using ContentType.parser for charset if (contentTypeString.indexOf("charset") > 0) { contentType = ContentType.parse(contentTypeString); } else { contentType = ContentType.create(contentTypeString); } } - + if (contentTypeString != null && HttpConstants.CONTENT_TYPE_JAVA_SERIALIZED_OBJECT.equals(contentTypeString)) { // serialized java object Serializable obj = in.getMandatoryBody(Serializable.class); http://git-wip-us.apache.org/repos/asf/camel/blob/660ebaaf/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpCompressionTest.java ---------------------------------------------------------------------- diff --git a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpCompressionTest.java b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpCompressionTest.java index e6d3d9e..e9aba3e 100644 --- a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpCompressionTest.java +++ b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpCompressionTest.java @@ -50,8 +50,8 @@ import org.apache.http.util.EntityUtils; import org.junit.Test; /** - * - * @version + * + * @version */ public class HttpCompressionTest extends BaseHttpTest { @@ -71,9 +71,8 @@ public class HttpCompressionTest extends BaseHttpTest { assertNotNull(out); Map<String, Object> headers = out.getHeaders(); - System.out.println(headers); assertEquals(HttpStatus.SC_OK, headers.get(Exchange.HTTP_RESPONSE_CODE)); - + assertBody(out.getBody(String.class)); } @@ -132,7 +131,7 @@ public class HttpCompressionTest extends BaseHttpTest { public long getContentLength() { return -1; } - + @Override public boolean isStreaming() { return false; @@ -170,11 +169,11 @@ public class HttpCompressionTest extends BaseHttpTest { public long getContentLength() { return -1; } - + @Override public boolean isStreaming() { return false; } } } -} \ No newline at end of file +}
