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:35:47 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 2c8472de7 -> 3e52647fb


[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/3e52647f
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/3e52647f
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/3e52647f

Branch: refs/heads/master
Commit: 3e52647fb66d3d6e0cb42eb286fec056fc036a81
Parents: 2c8472d
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:35:29 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/3e52647f/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 28bd6c3..019a515 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
@@ -593,9 +593,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/3e52647f/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 f315564..8fd0743 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
@@ -136,7 +136,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/3e52647f/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 8c9b9cb..8361ad0 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
@@ -272,9 +272,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