cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6393] Preserving the paramerized type given to InvocationCallback
Date Wed, 06 May 2015 16:24:22 GMT
Repository: cxf
Updated Branches:
  refs/heads/master c7db05bc5 -> d1e2813df


[CXF-6393] Preserving the paramerized type given to InvocationCallback


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

Branch: refs/heads/master
Commit: d1e2813df2a478fc4c0d84896fd696fe242ae1af
Parents: c7db05b
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Wed May 6 17:24:00 2015 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Wed May 6 17:24:00 2015 +0100

----------------------------------------------------------------------
 .../org/apache/cxf/jaxrs/client/WebClient.java  |  1 -
 .../apache/cxf/systest/jaxrs/BookServer20.java  |  3 +++
 .../jaxrs/JAXRS20ClientServerBookTest.java      | 22 +++++++++++++++++---
 3 files changed, 22 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/d1e2813d/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
index 5097bec..259e769 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
@@ -941,7 +941,6 @@ public class WebClient extends AbstractClient {
             ParameterizedType pt = (ParameterizedType)outType;
             if (pt.getRawType() instanceof Class) {
                 respClass = (Class<?>)pt.getRawType();
-                outType = InjectionUtils.getActualType(pt);
             }
         } 
         

http://git-wip-us.apache.org/repos/asf/cxf/blob/d1e2813d/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer20.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer20.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer20.java
index 8fed831..17e8f60 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer20.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer20.java
@@ -59,6 +59,8 @@ import javax.ws.rs.ext.ReaderInterceptorContext;
 import javax.ws.rs.ext.WriterInterceptor;
 import javax.ws.rs.ext.WriterInterceptorContext;
 
+import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
+
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.common.util.StringUtils;
@@ -95,6 +97,7 @@ public class BookServer20 extends AbstractBusTestServerBase {
         providers.add(new FaultyContainerRequestFilter());
         providers.add(new PreMatchReplaceStreamOrAddress());
         providers.add(new GenericHandlerWriter());
+        providers.add(new JacksonJaxbJsonProvider());
         sf.setProviders(providers);
         sf.setResourceProvider(BookStore.class,
                                new SingletonResourceProvider(new BookStore(), true));

http://git-wip-us.apache.org/repos/asf/cxf/blob/d1e2813d/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java
index 5bd1740..6d924ac 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java
@@ -55,6 +55,8 @@ import javax.xml.bind.JAXBElement;
 import javax.xml.namespace.QName;
 import javax.xml.ws.Holder;
 
+import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
+
 import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
 import org.apache.cxf.jaxrs.client.WebClient;
 import org.apache.cxf.jaxrs.provider.JAXBElementProvider;
@@ -358,17 +360,31 @@ public class JAXRS20ClientServerBookTest extends AbstractBusClientServerTestBase
     }
     
     @Test
-    public void testPostGetCollectionGenericEntityAndType() throws Exception {
+    public void testPostGetCollectionGenericEntityAndTypeXml() throws Exception {
         
         String endpointAddress =
             "http://localhost:" + PORT + "/bookstore/collections"; 
         WebClient wc = WebClient.create(endpointAddress);
-        wc.accept("application/xml").type("application/xml");
+        doTestPostGetCollectionGenericEntityAndType(wc, "application/xml");
+    }
+    @Test
+    public void testPostGetCollectionGenericEntityAndTypeJson() throws Exception {
+        
+        String endpointAddress =
+            "http://localhost:" + PORT + "/bookstore/collections"; 
+        WebClient wc = WebClient.create(endpointAddress,
+                                        Collections.singletonList(new JacksonJaxbJsonProvider()));
+        doTestPostGetCollectionGenericEntityAndType(wc, "application/json");
+    }
+    
+    private void doTestPostGetCollectionGenericEntityAndType(WebClient wc, String mt) throws
Exception {
+        
+        wc.accept(mt).type(mt);
         GenericEntity<List<Book>> collectionEntity = createGenericEntity();
         final Holder<List<Book>> holder = new Holder<List<Book>>();
         InvocationCallback<List<Book>> callback = new CustomInvocationCallback(holder);
             
-        Future<List<Book>> future = wc.async().post(Entity.entity(collectionEntity,
"application/xml"),
+        Future<List<Book>> future = wc.async().post(Entity.entity(collectionEntity,
mt),
                                                     callback);    
             
         List<Book> books2 = future.get();


Mime
View raw message