cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1005275 - in /cxf/trunk: 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:20:36 GMT
Author: sergeyb
Date: Wed Oct  6 22:20:36 2010
New Revision: 1005275

URL: http://svn.apache.org/viewvc?rev=1005275&view=rev
Log:
Minor update to MediaType handler

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/MediaTypeHeaderProvider.java
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSMultipartTest.java
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/MultipartStore.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/MediaTypeHeaderProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/MediaTypeHeaderProvider.java?rev=1005275&r1=1005274&r2=1005275&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/MediaTypeHeaderProvider.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/MediaTypeHeaderProvider.java
Wed Oct  6 22:20:36 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/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSMultipartTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSMultipartTest.java?rev=1005275&r1=1005274&r2=1005275&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSMultipartTest.java
(original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSMultipartTest.java
Wed Oct  6 22:20:36 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/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/MultipartStore.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/MultipartStore.java?rev=1005275&r1=1005274&r2=1005275&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/MultipartStore.java
(original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/MultipartStore.java
Wed Oct  6 22:20:36 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