Author: sergeyb
Date: Tue Aug 20 13:51:25 2013
New Revision: 1515825
URL: http://svn.apache.org/r1515825
Log:
Merged revisions 1515823-1515824 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r1515823 | sergeyb | 2013-08-20 16:38:29 +0300 (Tue, 20 Aug 2013) | 1 line
[CXF-5204] Taking care of TypeVars wrapped in GenericEntity too
........
r1515824 | sergeyb | 2013-08-20 16:46:00 +0300 (Tue, 20 Aug 2013) | 1 line
Minor update to the test
........
Modified:
cxf/branches/2.7.x-fixes/ (props changed)
cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AbstractGenericBookStoreSpring.java
cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceJacksonSpringProviderTest.java
Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
Merged /cxf/trunk:r1515823-1515824
Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java?rev=1515825&r1=1515824&r2=1515825&view=diff
==============================================================================
---
cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
(original)
+++
cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
Tue Aug 20 13:51:25 2013
@@ -1246,7 +1246,7 @@ public final class InjectionUtils {
}
Type type = null;
if (GenericEntity.class.isAssignableFrom(targetObject.getClass())) {
- type = ((GenericEntity<?>)targetObject).getType();
+ type = processGenericTypeIfNeeded(serviceCls, targetType,
((GenericEntity<?>)targetObject).getType());
} else if (invoked == null
|| !invoked.getReturnType().isAssignableFrom(targetType)) {
// when a method has been invoked it is still possible that either
an ExceptionMapper
Modified:
cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AbstractGenericBookStoreSpring.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AbstractGenericBookStoreSpring.java?rev=1515825&r1=1515824&r2=1515825&view=diff
==============================================================================
---
cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AbstractGenericBookStoreSpring.java
(original)
+++
cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AbstractGenericBookStoreSpring.java
Tue Aug 20 13:51:25 2013
@@ -20,13 +20,16 @@
package org.apache.cxf.systest.jaxrs;
+import java.util.Collections;
import java.util.List;
import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.GenericEntity;
@Path("/")
@Consumes({"application/json", "application/xml" })
@@ -50,7 +53,16 @@ public abstract class AbstractGenericBoo
}
throw new WebApplicationException(400);
}
-
+
+ @SuppressWarnings("unchecked")
+ @GET
+ @Path("/books/superbooks2")
+ public GenericEntity<List<T>> getSuperBookCollectionGenericEntity() {
+ return new GenericEntity<List<T>>((List<T>)Collections.singletonList(
+ new SuperBook("Super", 124L, true))) {
+ };
+ }
+
}
Modified:
cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceJacksonSpringProviderTest.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceJacksonSpringProviderTest.java?rev=1515825&r1=1515824&r2=1515825&view=diff
==============================================================================
---
cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceJacksonSpringProviderTest.java
(original)
+++
cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceJacksonSpringProviderTest.java
Tue Aug 20 13:51:25 2013
@@ -26,6 +26,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.List;
+import javax.ws.rs.core.GenericType;
import javax.ws.rs.core.MediaType;
import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
@@ -209,6 +210,23 @@ public class JAXRSClientServerResourceJa
}
@Test
+ public void testGetGenericSuperBookCollectionWebClient() throws Exception {
+
+ String endpointAddress =
+ "http://localhost:" + PORT +
"/webapp/genericstore/books/superbooks2";
+ WebClient wc = WebClient.create(endpointAddress,
+ Collections.singletonList(new
JacksonJsonProvider()));
+
WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(100000000L);
+ wc.accept(MediaType.APPLICATION_JSON);
+ List<SuperBook> books = wc.get(new GenericType<List<SuperBook>>() {
+ });
+
+ SuperBook book = books.iterator().next();
+ assertEquals(124L, book.getId());
+ assertTrue(book.isSuperBook());
+ }
+
+ @Test
public void testEchoGenericSuperBookCollectionWebClientXml() throws
Exception {
String endpointAddress =