cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1005278 - in /cxf/branches/2.2.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/
Date Wed, 06 Oct 2010 22:26:18 GMT
Author: sergeyb
Date: Wed Oct  6 22:26:18 2010
New Revision: 1005278

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

........
  r1005275 | sergeyb | 2010-10-06 23:20:36 +0100 (Wed, 06 Oct 2010) | 1 line
  
  Minor update to MediaType handler
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/MediaTypeHeaderProvider.java
    cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSMultipartTest.java
    cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/MultipartStore.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
    svn:mergeinfo = /cxf/trunk:1005275

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

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/MediaTypeHeaderProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/MediaTypeHeaderProvider.java?rev=1005278&r1=1005277&r2=1005278&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/MediaTypeHeaderProvider.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/MediaTypeHeaderProvider.java
Wed Oct  6 22:26:18 2010
@@ -33,7 +33,7 @@ import javax.ws.rs.ext.RuntimeDelegate.H
 public class MediaTypeHeaderProvider implements HeaderDelegate<MediaType> {
 
     private static final Pattern COMPLEX_PARAMETERS = 
-        Pattern.compile("(([\\w-]+=\"[^\"]*\")|([\\w-]+=[\\w-]+))");
+        Pattern.compile("(([\\w-]+=\"[^\"]*\")|([\\w-]+=[\\w-/]+))");
     
     public MediaType fromString(String mType) {
         

Modified: cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSMultipartTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSMultipartTest.java?rev=1005278&r1=1005277&r2=1005278&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSMultipartTest.java
(original)
+++ cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSMultipartTest.java
Wed Oct  6 22:26:18 2010
@@ -255,15 +255,26 @@ public class JAXRSMultipartTest extends 
     
     @Test
     public void testAddCollectionOfBooksWithProxy() {
+        doTestAddCollectionOfBooksWithProxy(true);
+    }
+    
+    @Test
+    public void testAddCollectionOfBooksWithProxyWithoutHeader() {
+        doTestAddCollectionOfBooksWithProxy(false);
+    }
+    
+    public void doTestAddCollectionOfBooksWithProxy(boolean addHeader) {
         String address = "http://localhost:" + PORT;
         MultipartStore client = JAXRSClientFactory.create(address, MultipartStore.class);
         
-        WebClient.client(client).header("Content-Type", "multipart/mixed;type=application/xml");
+        if (addHeader) {
+            WebClient.client(client).header("Content-Type", "multipart/mixed;type=application/xml");
+        }
         
         List<Book> books = new ArrayList<Book>();
         books.add(new Book("CXF 1", 1L));
         books.add(new Book("CXF 2", 2L));
-        List<Book> books2 = client.addBooks(books);
+        List<Book> books2 = addHeader ? client.addBooks(books) : client.addBooksWithoutHeader(books);
         assertNotSame(books, books2);
         assertEquals(2, books2.size());
         assertEquals(books.get(0).getId(), books2.get(0).getId());

Modified: cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/MultipartStore.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/MultipartStore.java?rev=1005278&r1=1005277&r2=1005278&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/MultipartStore.java
(original)
+++ cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/MultipartStore.java
Wed Oct  6 22:26:18 2010
@@ -296,6 +296,14 @@ public class MultipartStore {
     }
     
     @POST
+    @Path("/books/jaxbonly")
+    @Consumes("multipart/mixed;type=text/xml")
+    @Produces("multipart/mixed;type=text/xml")
+    public List<Book> addBooksWithoutHeader(List<Book> books) {
+        return addBooks(books);
+    }
+    
+    @POST
     @Path("/books/jaxbjson")
     @Produces("text/xml")
     public Response addBookJaxbJson(



Mime
View raw message