cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1468839 - in /cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs: BookStore.java JAXRSClientServerBookTest.java
Date Wed, 17 Apr 2013 11:14:44 GMT
Author: sergeyb
Date: Wed Apr 17 11:14:43 2013
New Revision: 1468839

URL: http://svn.apache.org/r1468839
Log:
[CXF-4971] The system test

Modified:
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java

Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java?rev=1468839&r1=1468838&r2=1468839&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java (original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java Wed
Apr 17 11:14:43 2013
@@ -142,6 +142,14 @@ public class BookStore {
     }
     
     @GET
+    @Path("/dropjsonroot")
+    @Produces("application/json")
+    public Book getBookDropJsonRoot(@Context MessageContext mc) throws BookNotFoundFault
{
+        mc.put("drop.json.root.element", "true");
+        return doGetBook("123");
+    }
+    
+    @GET
     @Path("/booknames/123")
     @Produces("application/bar")
     public byte[] getBookName123() {

Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java?rev=1468839&r1=1468838&r2=1468839&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
(original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
Wed Apr 17 11:14:43 2013
@@ -1311,6 +1311,15 @@ public class JAXRSClientServerBookTest e
     }
     
     @Test
+    public void testDropJSONRootDynamically() {
+        WebClient wc = WebClient.create("http://localhost:" + PORT + "/bookstore/dropjsonroot");
+        wc.accept("application/json");
+        String response = wc.get(String.class);
+        // with root: {"Book":{"id":123,"name":"CXF in Action"}}
+        assertEquals("{\"id\":123,\"name\":\"CXF in Action\"}", response);
+    }
+    
+    @Test
     public void testFormattedJSON() {
         WebClient wc = WebClient.create("http://localhost:" + PORT + "/bookstore/books/123");
         wc.accept("application/json");



Mime
View raw message