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);
}