cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1041793 - in /cxf/branches/2.3.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/ sy...
Date Fri, 03 Dec 2010 13:01:11 GMT
Author: sergeyb
Date: Fri Dec  3 13:01:10 2010
New Revision: 1041793

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

........
  r1041790 | sergeyb | 2010-12-03 12:38:32 +0000 (Fri, 03 Dec 2010) | 1 line
  
  Minor update to have no-annotation jax-rs servers return explicit collections properly
........

Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotationsImpl.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotationsInterface.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerNonSpringBookTest.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/resources2.xml
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/resources/jaxrs_non_spring/WEB-INF/resources2.xml

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec  3 13:01:10 2010
@@ -1 +1 @@
-/cxf/trunk:1041183
+/cxf/trunk:1041183,1041790

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

Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java?rev=1041793&r1=1041792&r2=1041793&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
Fri Dec  3 13:01:10 2010
@@ -200,7 +200,7 @@ public class JAXRSOutInterceptor extends
         }
         Class<?> targetType = getRawResponseClass(responseObj);
         Type genericType = 
-            getGenericResponseType(ori == null ? null : ori.getAnnotatedMethod(), responseObj);
+            getGenericResponseType(ori == null ? null : invoked, responseObj);
         if (genericType instanceof TypeVariable) {
             genericType = InjectionUtils.getSuperType(ori.getClassResourceInfo().getServiceClass(),

                                                        (TypeVariable)genericType);

Modified: cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotationsImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotationsImpl.java?rev=1041793&r1=1041792&r2=1041793&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotationsImpl.java
(original)
+++ cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotationsImpl.java
Fri Dec  3 13:01:10 2010
@@ -20,6 +20,7 @@
 package org.apache.cxf.systest.jaxrs;
 
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import javax.ws.rs.WebApplicationException;
@@ -68,5 +69,9 @@ public class BookStoreNoAnnotationsImpl 
         ch2.setTitle(ch.getTitle());
         return ch2;
     }
+
+    public List<Book> getBooks(List<Book> thebooks) {
+        return thebooks;
+    }
     
 }

Modified: cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotationsInterface.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotationsInterface.java?rev=1041793&r1=1041792&r2=1041793&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotationsInterface.java
(original)
+++ cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotationsInterface.java
Fri Dec  3 13:01:10 2010
@@ -19,11 +19,15 @@
 
 package org.apache.cxf.systest.jaxrs;
 
+import java.util.List;
+
 
 public interface BookStoreNoAnnotationsInterface {
 
     Book getBook(Long id) throws BookNotFoundFault;
     
+    List<Book> getBooks(List<Book> thebooks);
+        
     ChapterNoAnnotations getBookChapter(Long id) throws BookNotFoundFault;
     
 }

Modified: cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerNonSpringBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerNonSpringBookTest.java?rev=1041793&r1=1041792&r2=1041793&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerNonSpringBookTest.java
(original)
+++ cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerNonSpringBookTest.java
Fri Dec  3 13:01:10 2010
@@ -20,12 +20,16 @@
 package org.apache.cxf.systest.jaxrs;
 
 import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
 
 import org.apache.commons.httpclient.Header;
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.methods.GetMethod;
 import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.io.CachedOutputStream;
+import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
+import org.apache.cxf.jaxrs.client.WebClient;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 
 import org.junit.BeforeClass;
@@ -74,6 +78,23 @@ public class JAXRSClientServerNonSpringB
     }
     
     @Test
+    public void testGetBooksUserModelInterface() throws Exception {
+        BookStoreNoAnnotationsInterface proxy = 
+            JAXRSClientFactory.createFromModel("http://localhost:" + PORT + "/usermodel2",

+                                              BookStoreNoAnnotationsInterface.class,
+                              "classpath:org/apache/cxf/systest/jaxrs/resources/resources2.xml",
null);
+        WebClient.getConfig(proxy).getHttpConduit().getClient().setReceiveTimeout(10000000);
+        Book book = new Book("From Model", 1L);
+        List<Book> books = new ArrayList<Book>();
+        books.add(book);
+        books = proxy.getBooks(books);
+        assertEquals(1, books.size());
+        assertNotSame(book, books.get(0));
+        assertEquals("From Model", books.get(0).getName());
+        
+    }
+    
+    @Test
     public void testGetBook123ApplicationSingleton() throws Exception {
         getAndCompareAsStrings("http://localhost:" + PORT + "/application/bookstore/books/123",
                                "resources/expected_get_book123.txt",

Modified: cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/resources2.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/resources2.xml?rev=1041793&r1=1041792&r2=1041793&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/resources2.xml
(original)
+++ cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/resources2.xml
Fri Dec  3 13:01:10 2010
@@ -3,6 +3,9 @@
     <operation name="getBook" verb="GET" path="/books/{id}">
        <param name="id" type="PATH"/>
     </operation>
+    <operation name="getBooks" verb="POST" path="/books">
+       <param name="thebooks" type="REQUEST_BODY"/>
+    </operation> 
     <operation name="getBookChapter" path="/books/{id}/chapter">
         <param name="id" type="PATH"/>
     </operation> 

Modified: cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/resources/jaxrs_non_spring/WEB-INF/resources2.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/resources/jaxrs_non_spring/WEB-INF/resources2.xml?rev=1041793&r1=1041792&r2=1041793&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/resources/jaxrs_non_spring/WEB-INF/resources2.xml
(original)
+++ cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/resources/jaxrs_non_spring/WEB-INF/resources2.xml
Fri Dec  3 13:01:10 2010
@@ -3,6 +3,9 @@
     <operation name="getBook" verb="GET" path="/books/{id}">
        <param name="id" type="PATH"/>
     </operation>
+    <operation name="getBooks" verb="POST" path="/books">
+       <param name="thebooks" type="REQUEST_BODY"/>
+    </operation>  
     <operation name="getBookChapter" path="/books/{id}/chapter">
         <param name="id" type="PATH"/>
     </operation> 



Mime
View raw message