cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r765795 - in /cxf/trunk: rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ systests/src/test/java/org/apache/cxf/systest/jaxrs/ systests/src/test/resources/jaxrs/WEB-INF/
Date Thu, 16 Apr 2009 22:37:44 GMT
Author: sergeyb
Date: Thu Apr 16 22:37:44 2009
New Revision: 765795

URL: http://svn.apache.org/viewvc?rev=765795&view=rev
Log:
JAXRS: Adding Aegis system test

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AegisElementProvider.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSpring.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
    cxf/trunk/systests/src/test/resources/jaxrs/WEB-INF/beans.xml

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AegisElementProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AegisElementProvider.java?rev=765795&r1=765794&r2=765795&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AegisElementProvider.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AegisElementProvider.java
Thu Apr 16 22:37:44 2009
@@ -26,6 +26,8 @@
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
 
+import javax.ws.rs.Consumes;
+import javax.ws.rs.Produces;
 import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
@@ -40,6 +42,8 @@
 import org.apache.cxf.staxutils.StaxUtils;
 
 @Provider
+@Produces({"application/xml", "application/*+xml", "text/xml" })
+@Consumes({"application/xml", "application/*+xml", "text/xml" })
 public final class AegisElementProvider extends AbstractAegisProvider  {
     
     public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations,
MediaType m, 

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSpring.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSpring.java?rev=765795&r1=765794&r2=765795&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSpring.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSpring.java Thu
Apr 16 22:37:44 2009
@@ -106,6 +106,17 @@
         return b;
     }
     
+    @GET
+    @Path("books/aegis")
+    @Produces({"application/html;q=1.0", "application/xml;q=0.5", "application/json;q=0.5"
})
+    public Book getBookAegis() {
+        // how to have Book2 populated ?
+        Book b = new Book();
+        b.setId(124);
+        b.setName("CXF in Action - 2");
+        return b;
+    }
+    
     
     
     final void init() {

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java?rev=765795&r1=765794&r2=765795&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
(original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
Thu Apr 16 22:37:44 2009
@@ -173,6 +173,14 @@
     }
     
     @Test
+    public void testAddGetBookAegis() throws Exception {
+        
+        String endpointAddress =
+            "http://localhost:9080/the/thebooks4/bookstore/books/aegis"; 
+        getBook(endpointAddress, "resources/expected_add_book_aegis.txt", "application/xml");

+    }
+    
+    @Test
     public void testAddValidBookJson() throws Exception {
         doPost("http://localhost:9080/the/bookstore/books/convert",
                200,

Modified: cxf/trunk/systests/src/test/resources/jaxrs/WEB-INF/beans.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/resources/jaxrs/WEB-INF/beans.xml?rev=765795&r1=765794&r2=765795&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/resources/jaxrs/WEB-INF/beans.xml (original)
+++ cxf/trunk/systests/src/test/resources/jaxrs/WEB-INF/beans.xml Thu Apr 16 22:37:44 2009
@@ -76,6 +76,18 @@
        <ref bean="jsonProvider"/>
     </jaxrs:providers> 
     
+  </jaxrs:server>
+  
+  <jaxrs:server id="bookservice4"
+		        address="/thebooks4/bookstore">
+    <jaxrs:serviceBeans>
+      <ref bean="serviceBean" />
+    </jaxrs:serviceBeans>		  
+    
+    <jaxrs:providers>
+       <bean class="org.apache.cxf.jaxrs.provider.AegisElementProvider"/>
+    </jaxrs:providers> 
+    
   </jaxrs:server> 
 
   <bean id="jaxbProvider" class="org.apache.cxf.jaxrs.provider.JAXBElementProvider">



Mime
View raw message