You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2014/08/21 11:35:23 UTC

[1/3] git commit: CAMEL-7615 Fixed the osgi itest failed tests of CxfProxyExampleTest

Repository: camel
Updated Branches:
  refs/heads/master 546a8ad67 -> b8e9430ab


CAMEL-7615 Fixed the osgi itest failed tests of CxfProxyExampleTest


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/56fe28ad
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/56fe28ad
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/56fe28ad

Branch: refs/heads/master
Commit: 56fe28ad9a1b2e889b71e4869042c68b1cff718b
Parents: 546a8ad
Author: Willem Jiang <wi...@gmail.com>
Authored: Thu Aug 21 17:12:05 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Thu Aug 21 17:12:05 2014 +0800

----------------------------------------------------------------------
 .../resources/org/apache/camel/itest/osgi/cxf/camel-config.xml     | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/56fe28ad/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cxf/camel-config.xml
----------------------------------------------------------------------
diff --git a/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cxf/camel-config.xml b/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cxf/camel-config.xml
index c7ca5d3..07dd7fe 100644
--- a/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cxf/camel-config.xml
+++ b/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cxf/camel-config.xml
@@ -59,6 +59,8 @@
             <to uri="log:input"/>
             <!-- enrich the input by ensure the incidentId parameter is set -->
             <to uri="bean:enrichBean"/>
+            <!-- Need to remove the http headers which could confuse the http endpoint -->
+            <removeHeaders pattern="CamelHttp*"/>
             <!-- send proxied request to real web service -->
             <to uri="http://localhost:9081/real-webservice?throwExceptionOnFailure=false"/>
             <!-- log answer from real web service -->


[2/3] git commit: Using http4.3 API when running the osgi test of CXF

Posted by ni...@apache.org.
Using http4.3 API when running the osgi test of CXF


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7c62ca9c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7c62ca9c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7c62ca9c

Branch: refs/heads/master
Commit: 7c62ca9c5c48dacd9b046e3a007f58567d649335
Parents: 56fe28a
Author: Willem Jiang <wi...@gmail.com>
Authored: Thu Aug 21 17:13:30 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Thu Aug 21 17:13:30 2014 +0800

----------------------------------------------------------------------
 .../itest/osgi/cxf/CxfBeanSpringRouteTest.java  |  6 +++--
 .../blueprint/CxfBeanBlueprintRouterTest.java   | 10 +++++---
 .../cxf/blueprint/CxfRsBlueprintRouterTest.java | 26 +++++++++++---------
 3 files changed, 24 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/7c62ca9c/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cxf/CxfBeanSpringRouteTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cxf/CxfBeanSpringRouteTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cxf/CxfBeanSpringRouteTest.java
index 5b01dc4..ebf2366 100644
--- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cxf/CxfBeanSpringRouteTest.java
+++ b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cxf/CxfBeanSpringRouteTest.java
@@ -20,7 +20,9 @@ import org.apache.camel.itest.osgi.OSGiIntegrationSpringTestSupport;
 import org.apache.http.HttpResponse;
 import org.apache.http.client.HttpClient;
 import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.impl.client.HttpClientBuilder;
 import org.apache.http.util.EntityUtils;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -41,7 +43,7 @@ public class CxfBeanSpringRouteTest extends OSGiIntegrationSpringTestSupport {
     public void testGetCustomer() throws Exception {
         HttpGet get = new HttpGet("http://localhost:9000/route/customerservice/customers/123");
         get.addHeader("Accept" , "application/json");
-        HttpClient httpclient = new DefaultHttpClient();
+        CloseableHttpClient httpclient = HttpClientBuilder.create().build();
 
         try {
             HttpResponse response = httpclient.execute(get);
@@ -49,7 +51,7 @@ public class CxfBeanSpringRouteTest extends OSGiIntegrationSpringTestSupport {
             assertEquals("{\"Customer\":{\"id\":123,\"name\":\"John\"}}",
                          EntityUtils.toString(response.getEntity()));
         } finally {
-            httpclient.getConnectionManager().shutdown();
+            httpclient.close();
         }
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/7c62ca9c/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cxf/blueprint/CxfBeanBlueprintRouterTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cxf/blueprint/CxfBeanBlueprintRouterTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cxf/blueprint/CxfBeanBlueprintRouterTest.java
index 462a98a..490eb94 100644
--- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cxf/blueprint/CxfBeanBlueprintRouterTest.java
+++ b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cxf/blueprint/CxfBeanBlueprintRouterTest.java
@@ -21,7 +21,9 @@ import org.apache.camel.itest.osgi.blueprint.OSGiBlueprintTestSupport;
 import org.apache.http.HttpResponse;
 import org.apache.http.client.HttpClient;
 import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.impl.client.HttpClientBuilder;
 import org.apache.http.util.EntityUtils;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -45,7 +47,7 @@ public class CxfBeanBlueprintRouterTest extends OSGiBlueprintTestSupport {
     public void testGetCustomer() throws Exception {
         HttpGet get = new HttpGet("http://localhost:9000/route/customerservice/customers/123");
         get.addHeader("Accept" , "application/json");
-        HttpClient httpclient = new DefaultHttpClient();
+        CloseableHttpClient httpclient = HttpClientBuilder.create().build();
 
         try {
             HttpResponse response = httpclient.execute(get);
@@ -53,7 +55,7 @@ public class CxfBeanBlueprintRouterTest extends OSGiBlueprintTestSupport {
             assertEquals("{\"Customer\":{\"id\":123,\"name\":\"John\"}}",
                          EntityUtils.toString(response.getEntity()));
         } finally {
-            httpclient.getConnectionManager().shutdown();
+            httpclient.close();
         }
     }
 
@@ -62,7 +64,7 @@ public class CxfBeanBlueprintRouterTest extends OSGiBlueprintTestSupport {
     public void testGetCustomerWithQuery() throws Exception {
         HttpGet get = new HttpGet("http://localhost:9000/route/customerservice/customers?id=123");
         get.addHeader("Accept" , "application/json");
-        HttpClient httpclient = new DefaultHttpClient();
+        CloseableHttpClient httpclient = HttpClientBuilder.create().build();
 
         try {
             HttpResponse response = httpclient.execute(get);
@@ -70,7 +72,7 @@ public class CxfBeanBlueprintRouterTest extends OSGiBlueprintTestSupport {
             assertEquals("{\"Customer\":{\"id\":123,\"name\":\"John\"}}",
                          EntityUtils.toString(response.getEntity()));
         } finally {
-            httpclient.getConnectionManager().shutdown();
+            httpclient.close();
         }
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/7c62ca9c/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cxf/blueprint/CxfRsBlueprintRouterTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cxf/blueprint/CxfRsBlueprintRouterTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cxf/blueprint/CxfRsBlueprintRouterTest.java
index 65eee47..f456e27 100644
--- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cxf/blueprint/CxfRsBlueprintRouterTest.java
+++ b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cxf/blueprint/CxfRsBlueprintRouterTest.java
@@ -28,7 +28,9 @@ import org.apache.http.client.methods.HttpGet;
 import org.apache.http.client.methods.HttpPost;
 import org.apache.http.client.methods.HttpPut;
 import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.impl.client.HttpClientBuilder;
 import org.apache.http.util.EntityUtils;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
@@ -73,7 +75,7 @@ public class CxfRsBlueprintRouterTest extends OSGiBlueprintTestSupport {
     public void testGetCustomer() throws Exception {
         HttpGet get = new HttpGet("http://localhost:9000/route/customerservice/customers/123");
         get.addHeader("Accept" , "application/json");
-        HttpClient httpclient = new DefaultHttpClient();
+        CloseableHttpClient httpclient = HttpClientBuilder.create().build();
 
         try {
             HttpResponse response = httpclient.execute(get);
@@ -85,7 +87,7 @@ public class CxfRsBlueprintRouterTest extends OSGiBlueprintTestSupport {
             boolean isMary = "{\"Customer\":{\"id\":123,\"name\":\"Mary\"}}".equals(s);
             assertTrue("Should be John or Mary", isJohn || isMary);
         } finally {
-            httpclient.getConnectionManager().shutdown();
+            httpclient.close();
         }
     }
     
@@ -94,7 +96,7 @@ public class CxfRsBlueprintRouterTest extends OSGiBlueprintTestSupport {
     public void testGetCustomerWithQuery() throws Exception {      
         HttpGet get = new HttpGet("http://localhost:9000/route/customerservice/customers?id=123");
         get.addHeader("Accept" , "application/json");
-        HttpClient httpclient = new DefaultHttpClient();
+        CloseableHttpClient httpclient = HttpClientBuilder.create().build();
 
         try {
             HttpResponse response = httpclient.execute(get);
@@ -102,7 +104,7 @@ public class CxfRsBlueprintRouterTest extends OSGiBlueprintTestSupport {
             assertEquals("{\"Customer\":{\"id\":123,\"name\":\"John\"}}", 
                          EntityUtils.toString(response.getEntity()));
         } finally {
-            httpclient.getConnectionManager().shutdown();
+            httpclient.close();
         }
     }
     
@@ -110,7 +112,7 @@ public class CxfRsBlueprintRouterTest extends OSGiBlueprintTestSupport {
     public void testGetCustomers() throws Exception {      
         HttpGet get = new HttpGet("http://localhost:9000/route/customerservice/customers/");
         get.addHeader("Accept" , "application/xml");
-        HttpClient httpclient = new DefaultHttpClient();
+        CloseableHttpClient httpclient = HttpClientBuilder.create().build();
 
         try {
             HttpResponse response = httpclient.execute(get);
@@ -125,7 +127,7 @@ public class CxfRsBlueprintRouterTest extends OSGiBlueprintTestSupport {
                 fail("Not expected body returned: " + s);
             }
         } finally {
-            httpclient.getConnectionManager().shutdown();
+            httpclient.close();
         }
     }
     
@@ -133,7 +135,7 @@ public class CxfRsBlueprintRouterTest extends OSGiBlueprintTestSupport {
     public void testGetSubResource() throws Exception {
         HttpGet get = new HttpGet("http://localhost:9000/route/customerservice/orders/223/products/323");
         get.addHeader("Accept" , "application/json");
-        HttpClient httpclient = new DefaultHttpClient();
+        CloseableHttpClient httpclient = HttpClientBuilder.create().build();
 
         try {
             HttpResponse response = httpclient.execute(get);
@@ -141,7 +143,7 @@ public class CxfRsBlueprintRouterTest extends OSGiBlueprintTestSupport {
             assertEquals("{\"Product\":{\"description\":\"product 323\",\"id\":323}}", 
                          EntityUtils.toString(response.getEntity()));
         } finally {
-            httpclient.getConnectionManager().shutdown();
+            httpclient.close();
         }
     }
     
@@ -151,14 +153,14 @@ public class CxfRsBlueprintRouterTest extends OSGiBlueprintTestSupport {
         StringEntity entity = new StringEntity(PUT_REQUEST, "ISO-8859-1");
         entity.setContentType("text/xml; charset=ISO-8859-1");
         put.setEntity(entity);
-        HttpClient httpclient = new DefaultHttpClient();
+        CloseableHttpClient httpclient = HttpClientBuilder.create().build();
 
         try {
             HttpResponse response = httpclient.execute(put);
             assertEquals(200, response.getStatusLine().getStatusCode());
             assertEquals("", EntityUtils.toString(response.getEntity()));
         } finally {
-            httpclient.getConnectionManager().shutdown();
+            httpclient.close();
         }
     }
     
@@ -169,7 +171,7 @@ public class CxfRsBlueprintRouterTest extends OSGiBlueprintTestSupport {
         StringEntity entity = new StringEntity(POST_REQUEST, "ISO-8859-1");
         entity.setContentType("text/xml; charset=ISO-8859-1");
         post.setEntity(entity);
-        HttpClient httpclient = new DefaultHttpClient();
+        CloseableHttpClient httpclient = HttpClientBuilder.create().build();
 
         try {
             HttpResponse response = httpclient.execute(post);
@@ -177,7 +179,7 @@ public class CxfRsBlueprintRouterTest extends OSGiBlueprintTestSupport {
             assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Customer><id>124</id><name>Jack</name></Customer>",
                          EntityUtils.toString(response.getEntity()));
         } finally {
-            httpclient.getConnectionManager().shutdown();
+            httpclient.close();
         }
 
     }


[3/3] git commit: Revert httpclient4 version to 4.3.3 due to HTTPCLIENT-1478

Posted by ni...@apache.org.
Revert httpclient4 version to 4.3.3 due to HTTPCLIENT-1478


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b8e9430a
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b8e9430a
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b8e9430a

Branch: refs/heads/master
Commit: b8e9430abb4a51a65983ed6f13b7cc34febbdae4
Parents: 7c62ca9
Author: Willem Jiang <wi...@gmail.com>
Authored: Thu Aug 21 17:31:32 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Thu Aug 21 17:31:32 2014 +0800

----------------------------------------------------------------------
 parent/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b8e9430a/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index ebaf300..385de18 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -189,7 +189,7 @@
     <htmlunit.version>2.15</htmlunit.version>
     <httpunit-version>1.7</httpunit-version>
     <httpcore4-version>4.3.2</httpcore4-version>
-    <httpclient4-version>4.3.5</httpclient4-version>
+    <httpclient4-version>4.3.3</httpclient4-version>
     <httpclient-version>3.1</httpclient-version>
     <ibatis-bundle-version>2.3.4.726_4</ibatis-bundle-version>
     <ibatis-version>2.3.4.726</ibatis-version>