cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1099498 - in /cxf/branches/2.3.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/
Date Wed, 04 May 2011 15:55:50 GMT
Author: sergeyb
Date: Wed May  4 15:55:50 2011
New Revision: 1099498

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

........
  r1099496 | sergeyb | 2011-05-04 16:50:22 +0100 (Wed, 04 May 2011) | 1 line
  
  [CXF-3489] JSON sequences created from explicit collections of unqualified beans can not
be read without additional configuration
........

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/JSONProvider.java
    cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JSONProviderTest.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed May  4 15:55:50 2011
@@ -1 +1 @@
-/cxf/trunk:1094926,1094992,1095349,1095666,1097071,1097175,1097178,1097816,1099421
+/cxf/trunk:1094926,1094992,1095349,1095666,1097071,1097175,1097178,1097816,1099421,1099496

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/JSONProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java?rev=1099498&r1=1099497&r2=1099498&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
Wed May  4 15:55:50 2011
@@ -333,7 +333,7 @@ public class JSONProvider extends Abstra
                 qname = el.getName();
                 actualClass = el.getDeclaredType();
             } else {
-                qname = getCollectionWrapperQName(actualClass, genericType, firstObj, true);
+                qname = getCollectionWrapperQName(actualClass, genericType, firstObj, false);
             }
             if (qname.getNamespaceURI().length() > 0) {
                 startTag = "{\"ns1." + qname.getLocalPart() + "\":[";

Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JSONProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JSONProviderTest.java?rev=1099498&r1=1099497&r2=1099498&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JSONProviderTest.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JSONProviderTest.java
Wed May  4 15:55:50 2011
@@ -391,6 +391,20 @@ public class JSONProviderTest extends As
     }
     
     @Test
+    public void testWriteUnqualifiedCollection() throws Exception {
+        JSONProvider p = new JSONProvider();
+        List<Book> books = new ArrayList<Book>();
+        books.add(new Book("CXF", 123L));
+        ByteArrayOutputStream os = new ByteArrayOutputStream();
+        Method m = CollectionsResource.class.getMethod("getBooks", new Class[0]);
+        p.writeTo(books, m.getReturnType(), m.getGenericReturnType(), new Annotation[0],

+                  MediaType.APPLICATION_JSON_TYPE, new MetadataMap<String, Object>(),
os);
+        assertEquals("{\"Book\":[{\"id\":123,\"name\":\"CXF\",\"state\":\"\"}]}",
+                     os.toString());
+        
+    }
+    
+    @Test
     public void testReadUnqualifiedCollection() throws Exception {
         String data = "{\"Book\":[{\"id\":\"123\",\"name\":\"CXF in Action\"}"
             + ",{\"id\":\"124\",\"name\":\"CXF Rocks\"}]}";

Modified: cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java?rev=1099498&r1=1099497&r2=1099498&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
(original)
+++ cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
Wed May  4 15:55:50 2011
@@ -926,7 +926,7 @@ public class JAXRSClientServerBookTest e
         WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(10000000);
         Response r = wc.type("application/xml").accept("application/json")
             .post(new Books(new Book("CXF", 123L)));
-        assertEquals("{\"Books\":[{\"id\":123,\"name\":\"CXF\"}]}",
+        assertEquals("{\"Book\":[{\"id\":123,\"name\":\"CXF\"}]}",
                      IOUtils.readStringFromStream((InputStream)r.getEntity()));
     }
     



Mime
View raw message