cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1457026 - in /cxf/branches/2.7.x-fixes: ./ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/
Date Fri, 15 Mar 2013 17:17:21 GMT
Author: sergeyb
Date: Fri Mar 15 17:17:20 2013
New Revision: 1457026

URL: http://svn.apache.org/r1457026
Log:
Merged revisions 1457021 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1457021 | sergeyb | 2013-03-15 17:08:40 +0000 (Fri, 15 Mar 2013) | 1 line
  
  [CXF-4891] Adding a test where the content type is modified directly from MBW
........

Added:
    cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/ContentTypeModifyingMBW.java
      - copied unchanged from r1457021, cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/ContentTypeModifyingMBW.java
Modified:
    cxf/branches/2.7.x-fixes/   (props changed)
    cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java
    cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
    cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java

Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
    svn:mergeinfo = /cxf/trunk:1457021

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

Modified: cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java?rev=1457026&r1=1457025&r2=1457026&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java
(original)
+++ cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java
Fri Mar 15 17:17:20 2013
@@ -63,6 +63,7 @@ public class BookServer extends Abstract
         p.setEnableBuffering(true);
         p.setReportByteArraySize(true);
         providers.add(p);
+        providers.add(new ContentTypeModifyingMBW());
         JAXBElementProvider<?> jaxbProvider = new JAXBElementProvider<Object>();
         Map<String, String> jaxbElementClassMap = new HashMap<String, String>();

         jaxbElementClassMap.put(BookNoXmlRootElement.class.getName(), "BookNoXmlRootElement");

Modified: cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java?rev=1457026&r1=1457025&r2=1457026&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
(original)
+++ cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
Fri Mar 15 17:17:20 2013
@@ -134,6 +134,13 @@ public class BookStore {
     }
 
     @GET
+    @Path("/customtext")
+    @Produces("text/custom")
+    public String getCustomBookTest() {
+        return "Good book";
+    }
+    
+    @GET
     @Path("/booknames/123")
     @Produces("application/bar")
     public byte[] getBookName123() {

Modified: cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java?rev=1457026&r1=1457025&r2=1457026&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
(original)
+++ cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
Fri Mar 15 17:17:20 2013
@@ -86,6 +86,18 @@ public class JAXRSClientServerBookTest e
         createStaticBus();
     }
     
+
+    
+    @Test
+    public void testGetCustomBookText() {
+        String address = "http://localhost:" + PORT + "/bookstore/customtext";
+        WebClient wc = WebClient.create(address);
+        Response r = wc.accept("text/custom").get();
+        String name = r.readEntity(String.class);
+        assertEquals("Good book", name);
+        assertEquals("text/custom;charset=us-ascii", r.getMediaType().toString());
+    }    
+    
     @Test
     public void testGetBookNameAsByteArray() {
         String address = "http://localhost:" + PORT + "/bookstore/booknames/123";



Mime
View raw message