cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: [CXF-5656] Fixing HTTP transport issue to do with losing CT parameters in case of 500
Date Thu, 27 Mar 2014 16:46:19 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes 4277dc8fc -> 528adec2e


[CXF-5656] Fixing HTTP transport issue to do with losing CT parameters in case of 500


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

Branch: refs/heads/2.7.x-fixes
Commit: 528adec2e811b700c52f0b2064df4b43ff28a0b3
Parents: 4277dc8
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Thu Mar 27 16:35:29 2014 +0000
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Thu Mar 27 16:42:26 2014 +0000

----------------------------------------------------------------------
 .../org/apache/cxf/transport/http/AbstractHTTPDestination.java   | 3 ---
 .../src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java   | 3 ++-
 .../org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java  | 4 ++++
 3 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/528adec2/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
index 19510d9..c032e12 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
@@ -573,9 +573,6 @@ public abstract class AbstractHTTPDestination
 
         int responseCode = getReponseCodeFromMessage(outMessage);
         response.setStatus(responseCode);
-        if (HttpURLConnection.HTTP_INTERNAL_ERROR == responseCode) {
-            new Headers(outMessage).removeContentType();
-        }
         new Headers(outMessage).copyToResponse(response);
 
         outMessage.put(RESPONSE_HEADERS_COPIED, "true");

http://git-wip-us.apache.org/repos/asf/cxf/blob/528adec2/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java
index 03e576b..3c07227 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java
@@ -125,7 +125,8 @@ public class BookServer extends AbstractBusTestServerBase {
     private static class BusMapperExceptionMapper implements ExceptionMapper<BusMapperException>
{
 
         public Response toResponse(BusMapperException exception) {
-            return Response.serverError().header("BusMapper", "the-mapper").build();
+            return Response.serverError().type("text/plain;charset=utf-8").header("BusMapper",
"the-mapper")
+                .entity("BusMapperException").build();
         }
         
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/528adec2/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
index 1153fb7..c67bcb3 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
@@ -266,9 +266,13 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase
{
     public void testUseMapperOnBus() {
         String address = "http://localhost:" + PORT + "/bookstore/mapperonbus";
         WebClient wc = WebClient.create(address);
+        WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(10000000L);
         Response r = wc.post(null);
         assertEquals(500, r.getStatus());
+        MediaType mt = r.getMediaType();
+        assertEquals("text/plain;charset=utf-8", mt.toString().toLowerCase());
         assertEquals("the-mapper", r.getHeaderString("BusMapper"));
+        assertEquals("BusMapperException", r.readEntity(String.class));
     }
     
     @Test


Mime
View raw message