Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 65EB499CC for ; Tue, 13 Dec 2011 01:12:21 +0000 (UTC) Received: (qmail 75527 invoked by uid 500); 13 Dec 2011 01:12:21 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 75495 invoked by uid 500); 13 Dec 2011 01:12:21 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 75488 invoked by uid 99); 13 Dec 2011 01:12:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Dec 2011 01:12:20 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Dec 2011 01:12:17 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 705BA23889E2 for ; Tue, 13 Dec 2011 01:11:55 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1213531 - in /camel/branches/camel-2.8.x: ./ components/camel-http4/src/main/java/org/apache/camel/component/http4/ tests/camel-itest/src/test/java/org/apache/camel/itest/http/ Date: Tue, 13 Dec 2011 01:11:55 -0000 To: commits@camel.apache.org From: ningjiang@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111213011155.705BA23889E2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ningjiang Date: Tue Dec 13 01:11:54 2011 New Revision: 1213531 URL: http://svn.apache.org/viewvc?rev=1213531&view=rev Log: Merged revisions 1213219,1213526 via svnmerge from https://svn.apache.org/repos/asf/camel/trunk ........ r1213219 | ningjiang | 2011-12-12 20:56:31 +0800 (Mon, 12 Dec 2011) | 1 line CAMEL-4768 Fix the issue that camel-http4 component send the endpoint parameters ........ r1213526 | ningjiang | 2011-12-13 08:58:49 +0800 (Tue, 13 Dec 2011) | 1 line CAMEL-4768 fix a CS error ........ Modified: camel/branches/camel-2.8.x/ (props changed) camel/branches/camel-2.8.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpComponent.java camel/branches/camel-2.8.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java camel/branches/camel-2.8.x/tests/camel-itest/src/test/java/org/apache/camel/itest/http/Http4RouteTest.java Propchange: camel/branches/camel-2.8.x/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue Dec 13 01:11:54 2011 @@ -1 +1 @@ -/camel/trunk:1202148,1202167,1202204-1202206,1202214-1202215,1202223,1202659,1202685,1203879,1203978,1204338,1205124,1205372,1205412,1205429,1205431,1205713,1206116,1206414,1207743,1207784,1208301,1208930,1208964-1208965,1209006-1209007,1209382,1209401,1209477,1209845-1209846,1210113,1210771,1210830,1211363,1211414,1211773,1211811,1212275-1212276,1212408,1213197 +/camel/trunk:1202148,1202167,1202204-1202206,1202214-1202215,1202223,1202659,1202685,1203879,1203978,1204338,1205124,1205372,1205412,1205429,1205431,1205713,1206116,1206414,1207743,1207784,1208301,1208930,1208964-1208965,1209006-1209007,1209382,1209401,1209477,1209845-1209846,1210113,1210771,1210830,1211363,1211414,1211773,1211811,1212275-1212276,1212408,1213197,1213219,1213526 Propchange: camel/branches/camel-2.8.x/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: camel/branches/camel-2.8.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpComponent.java URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpComponent.java?rev=1213531&r1=1213530&r2=1213531&view=diff ============================================================================== --- camel/branches/camel-2.8.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpComponent.java (original) +++ camel/branches/camel-2.8.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpComponent.java Tue Dec 13 01:11:54 2011 @@ -193,7 +193,10 @@ public class HttpComponent extends Heade // create the configurer to use for this endpoint HttpClientConfigurer configurer = createHttpClientConfigurer(parameters, secure); URI endpointUri = URISupport.createRemainingURI(new URI(addressUri), CastUtils.cast(httpClientParameters)); - // restructure uri to be based on the parameters left as we dont want to include the Camel internal options + // create the endpoint and set the http uri to be null + HttpEndpoint endpoint = new HttpEndpoint(endpointUri.toString(), this, clientParams, clientConnectionManager, configurer); + // configure the endpoint + setProperties(endpoint, parameters); // The httpUri should be start with http or https String httpUriAddress = addressUri; if (addressUri.startsWith("http4")) { @@ -202,6 +205,8 @@ public class HttpComponent extends Heade if (addressUri.startsWith("https4")) { httpUriAddress = "https" + addressUri.substring(6); } + // restructure uri to be based on the parameters left as we dont want to include the Camel internal options + // build up the http uri URI httpUri = URISupport.createRemainingURI(new URI(httpUriAddress), CastUtils.cast(parameters)); // validate http uri that end-user did not duplicate the http part that can be a common error @@ -213,14 +218,7 @@ public class HttpComponent extends Heade "The uri part is not configured correctly. You have duplicated the http(s) protocol."); } } - - // register port on schema registry - int port = getPort(httpUri); - registerPort(secure, x509HostnameVerifier, port, sslContextParameters); - - // create the endpoint - HttpEndpoint endpoint = new HttpEndpoint(endpointUri.toString(), this, httpUri, clientParams, clientConnectionManager, configurer); - setProperties(endpoint, parameters); + endpoint.setHttpUri(httpUri); setEndpointHeaderFilterStrategy(endpoint); endpoint.setBinding(getHttpBinding()); if (httpBinding != null) { @@ -229,10 +227,13 @@ public class HttpComponent extends Heade if (httpClientConfigurer != null) { endpoint.setHttpClientConfigurer(httpClientConfigurer); } + // register port on schema registry + int port = getPort(httpUri); + registerPort(secure, x509HostnameVerifier, port, sslContextParameters); return endpoint; } - + private static int getPort(URI uri) { int port = uri.getPort(); if (port < 0) { Modified: camel/branches/camel-2.8.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java?rev=1213531&r1=1213530&r2=1213531&view=diff ============================================================================== --- camel/branches/camel-2.8.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java (original) +++ camel/branches/camel-2.8.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java Tue Dec 13 01:11:54 2011 @@ -69,6 +69,11 @@ public class HttpEndpoint extends Defaul public HttpEndpoint(String endPointURI, HttpComponent component, URI httpURI, ClientConnectionManager clientConnectionManager) throws URISyntaxException { this(endPointURI, component, httpURI, new BasicHttpParams(), clientConnectionManager, null); } + + public HttpEndpoint(String endPointURI, HttpComponent component, HttpParams clientParams, + ClientConnectionManager clientConnectionManager, HttpClientConfigurer clientConfigurer) throws URISyntaxException { + this(endPointURI, component, null, clientParams, clientConnectionManager, clientConfigurer); + } public HttpEndpoint(String endPointURI, HttpComponent component, URI httpURI, HttpParams clientParams, ClientConnectionManager clientConnectionManager, HttpClientConfigurer clientConfigurer) throws URISyntaxException { Modified: camel/branches/camel-2.8.x/tests/camel-itest/src/test/java/org/apache/camel/itest/http/Http4RouteTest.java URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/tests/camel-itest/src/test/java/org/apache/camel/itest/http/Http4RouteTest.java?rev=1213531&r1=1213530&r2=1213531&view=diff ============================================================================== --- camel/branches/camel-2.8.x/tests/camel-itest/src/test/java/org/apache/camel/itest/http/Http4RouteTest.java (original) +++ camel/branches/camel-2.8.x/tests/camel-itest/src/test/java/org/apache/camel/itest/http/Http4RouteTest.java Tue Dec 13 01:11:54 2011 @@ -32,7 +32,8 @@ public class Http4RouteTest extends Came @Test public void sendHttpGetRequestTest() { String response = template.requestBody("http4://localhost:" + port - + "/test?aa=bb&httpClient.soTimeout=10000&httpClient.connectionTimeout=10000" , null, String.class); + + "/test?aa=bb&httpClient.soTimeout=10000&httpClient.connectionTimeout=10000" + + "&bridgeEndpoint=true&throwExceptionOnFailure=false" , null, String.class); assertEquals("aa=bb", response); }