cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r833909 [2/2] - in /cxf/trunk: rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/multipart/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ rt/frontend/jaxrs/src/ma...
Date Sun, 08 Nov 2009 18:32:42 GMT
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=833909&r1=833908&r2=833909&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
Sun Nov  8 18:32:41 2009
@@ -223,6 +223,64 @@
     }
     
     @POST
+    @Path("/books/jsonform")
+    @Produces("text/xml")
+    @Consumes("multipart/form-data")
+    public Response addBookJsonFromForm(Book b1) 
+        throws Exception {
+        b1.setId(124);
+        return Response.ok(b1).build();
+    }
+    
+    @POST
+    @Path("/books/filesform")
+    @Produces("text/xml")
+    @Consumes("multipart/form-data")
+    public Response addBookFilesForm(@Multipart("owner") String name, 
+                                     @Multipart("files") List<Book> books) 
+        throws Exception {
+        if (books.size() != 2) {
+            throw new WebApplicationException();
+        }
+        Book b1 = books.get(0);
+        Book b2 = books.get(1);
+        if (!"CXF in Action - 1".equals(b1.getName())
+            || !"CXF in Action - 2".equals(b2.getName())
+            || !"Larry".equals(name)) {
+            throw new WebApplicationException();
+        }
+        b1.setId(124);
+        b1.setName("CXF in Action - 2");
+        return Response.ok(b1).build();
+    }
+    
+    @POST
+    @Path("/books/jaxbform")
+    @Produces("text/xml")
+    @Consumes("multipart/form-data")
+    public Response addBookJaxbFromForm(Book b1) 
+        throws Exception {
+        b1.setId(124);
+        return Response.ok(b1).build();
+    }
+    
+    @POST
+    @Path("/books/jsonjaxbform")
+    @Produces("text/xml")
+    @Consumes("multipart/form-data")
+    public Response addBookJaxbJsonForm(@Multipart("jsonPart") Book b1, 
+                                        @Multipart("bookXML") Book b2) 
+        throws Exception {
+        if (!"CXF in Action - 1".equals(b1.getName())
+            || !"CXF in Action - 2".equals(b2.getName())) {
+            throw new WebApplicationException();
+        }
+        b2.setId(124);
+        return Response.ok(b2).build();
+    }
+    
+    
+    @POST
     @Path("/books/dsource2")
     @Produces("text/xml")
     public Response addBookFromDataSource2(@Multipart("rootPart") DataSource ds1,

Added: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/attachmentFormJaxb
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/attachmentFormJaxb?rev=833909&view=auto
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/attachmentFormJaxb
(added)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/attachmentFormJaxb
Sun Nov  8 18:32:41 2009
@@ -0,0 +1,7 @@
+
+--bqJky99mlBWa-ZuqjC53mG6EzbmlxB
+Content-Disposition: form-data; name="bookXML"
+Content-Type: application/xml
+
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Book><name>CXF
in Action - 2</name></Book>
+--bqJky99mlBWa-ZuqjC53mG6EzbmlxB--
\ No newline at end of file

Added: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/attachmentFormJson
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/attachmentFormJson?rev=833909&view=auto
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/attachmentFormJson
(added)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/attachmentFormJson
Sun Nov  8 18:32:41 2009
@@ -0,0 +1,8 @@
+
+--bqJky99mlBWa-ZuqjC53mG6EzbmlxB
+Content-Disposition: form-data; name="gazetteer"
+Content-Type: application/json; charset=US-ASCII
+Content-Transfer-Encoding: 8bit
+
+{"Book":{"name":"CXF in Action - 2","id":123}}
+--bqJky99mlBWa-ZuqjC53mG6EzbmlxB--
\ No newline at end of file

Added: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/attachmentFormJsonFiles
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/attachmentFormJsonFiles?rev=833909&view=auto
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/attachmentFormJsonFiles
(added)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/attachmentFormJsonFiles
Sun Nov  8 18:32:41 2009
@@ -0,0 +1,24 @@
+
+--bqJky99mlBWa-ZuqjC53mG6EzbmlxB
+Content-Disposition: form-data; name="owner"
+Content-Type: text/plain
+
+Larry
+--bqJky99mlBWa-ZuqjC53mG6EzbmlxB
+Content-Disposition: form-data; name="files"
+Content-Type: multipart/mixed; boundary=_Part_4_701508.1145579811786
+
+--_Part_4_701508.1145579811786
+Content-Disposition: form-data; name="book1"
+Content-Type: application/json; charset=US-ASCII
+Content-Transfer-Encoding: 8bit
+
+{"Book":{"name":"CXF in Action - 1","id":123}}
+--_Part_4_701508.1145579811786
+Content-Disposition: form-data; name="book2"
+Content-Type: application/json; charset=US-ASCII
+Content-Transfer-Encoding: 8bit
+
+{"Book":{"name":"CXF in Action - 2","id":124}}
+--_Part_4_701508.1145579811786--
+--bqJky99mlBWa-ZuqjC53mG6EzbmlxB--
\ No newline at end of file

Added: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/attachmentFormJsonJaxb
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/attachmentFormJsonJaxb?rev=833909&view=auto
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/attachmentFormJsonJaxb
(added)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/attachmentFormJsonJaxb
Sun Nov  8 18:32:41 2009
@@ -0,0 +1,16 @@
+
+--bqJky99mlBWa-ZuqjC53mG6EzbmlxB
+Content-Disposition: form-data; name="bookJson"
+Content-Type: application/json; charset=US-ASCII
+Content-Transfer-Encoding: 8bit
+Content-ID: <jsonPart>
+
+{"Book":{"name":"CXF in Action - 1","id":123}}
+--bqJky99mlBWa-ZuqjC53mG6EzbmlxB
+Content-Disposition: form-data; name="bookXML"
+Content-Type: application/xml
+Content-Transfer-Encoding: 8bit
+Content-ID: <jaxbPart>
+
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Book><name>CXF
in Action - 2</name></Book>
+--bqJky99mlBWa-ZuqjC53mG6EzbmlxB--
\ No newline at end of file

Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/expected_get_chapter1.txt
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/expected_get_chapter1.txt?rev=833909&r1=833908&r2=833909&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/expected_get_chapter1.txt
(original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/expected_get_chapter1.txt
Sun Nov  8 18:32:41 2009
@@ -1 +1 @@
-<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?><Chapter><id>1</id><title>chapter
1</title></Chapter>
\ No newline at end of file
+<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?><Chapter><id>1</id><title>chapter
1</title></Chapter>
\ No newline at end of file



Mime
View raw message