cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1086591 - in /cxf/branches/2.3.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JAXBElementProviderTest.java
Date Tue, 29 Mar 2011 14:14:00 GMT
Author: sergeyb
Date: Tue Mar 29 14:14:00 2011
New Revision: 1086591

URL: http://svn.apache.org/viewvc?rev=1086591&view=rev
Log:
Merged revisions 1086588 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1086588 | sergeyb | 2011-03-29 15:10:05 +0100 (Tue, 29 Mar 2011) | 1 line
  
  [JAX-RS] Making sure JAXBProvider does not accept Response if unmarshalAsJaxbElement flag
is set
........

Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
    cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JAXBElementProviderTest.java

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 29 14:14:00 2011
@@ -1 +1 @@
-/cxf/trunk:1084966,1086102,1086115,1086535,1086573
+/cxf/trunk:1084966,1086102,1086115,1086535,1086573,1086588

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java?rev=1086591&r1=1086590&r2=1086591&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
Tue Mar 29 14:14:00 2011
@@ -337,7 +337,7 @@ public abstract class AbstractJAXBProvid
     }
     
     public boolean isReadable(Class<?> type, Type genericType, Annotation[] anns, MediaType
mt) {
-        return marshalAsJaxbElement || isSupported(type, genericType, anns);
+        return (marshalAsJaxbElement && type != Response.class) || isSupported(type,
genericType, anns);
     }
 
     public void setSchemaLocations(List<String> locations) {

Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JAXBElementProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JAXBElementProviderTest.java?rev=1086591&r1=1086590&r2=1086591&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JAXBElementProviderTest.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JAXBElementProviderTest.java
Tue Mar 29 14:14:00 2011
@@ -41,6 +41,7 @@ import java.util.TreeSet;
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
 import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBElement;
 import javax.xml.bind.JAXBException;
@@ -1007,6 +1008,23 @@ public class JAXBElementProviderTest ext
     }
     
     @Test 
+    public void testResponseIsNotReadable() {
+        JAXBElementProvider p = new JAXBElementProvider();
+        assertFalse(p.isReadable(Response.class, 
+                                 Response.class, 
+                                 new Annotation[]{}, MediaType.APPLICATION_XML_TYPE));
+    }
+    
+    @Test 
+    public void testResponseIsNotReadable2() {
+        JAXBElementProvider p = new JAXBElementProvider();
+        p.setUnmarshallAsJaxbElement(true);
+        assertFalse(p.isReadable(Response.class, 
+                                 Response.class, 
+                                 new Annotation[]{}, MediaType.APPLICATION_XML_TYPE));
+    }
+    
+    @Test 
     public void testPackageContextObjectFactory() {
         JAXBElementProvider p = new JAXBElementProvider();
         assertTrue(p.isReadable(org.apache.cxf.jaxrs.fortest.jaxb.Book.class, 



Mime
View raw message