cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1240252 - in /cxf/trunk: rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/
Date Fri, 03 Feb 2012 17:34:34 GMT
Author: sergeyb
Date: Fri Feb  3 17:34:33 2012
New Revision: 1240252

URL: http://svn.apache.org/viewvc?rev=1240252&view=rev
Log:
Updating the client proxy to ignore the Context parameters

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSubresource.java
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSubresourceImpl.java
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java?rev=1240252&r1=1240251&r2=1240252&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
Fri Feb  3 17:34:33 2012
@@ -205,7 +205,8 @@ public class ClientProxyImpl extends Abs
         }
         for (Parameter p : parameters) {
             if (p.getType() == ParameterType.CONTEXT) {
-                reportInvalidResourceMethod(ori.getMethodToInvoke(), "NO_CONTEXT_PARAMETERS");
+                // ignore
+                continue;
             }
             map.add(p.getType(), p);
         }

Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSubresource.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSubresource.java?rev=1240252&r1=1240251&r2=1240252&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSubresource.java
(original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSubresource.java
Fri Feb  3 17:34:33 2012
@@ -32,7 +32,9 @@ import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
 import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.UriInfo;
 
 public interface BookSubresource {
     
@@ -42,6 +44,11 @@ public interface BookSubresource {
     Book getTheBook() throws BookNotFoundFault;
     
     @GET
+    @Path("/subresource")
+    @Produces("application/xml")
+    Book getTheBookWithContext(@Context UriInfo ui) throws BookNotFoundFault;
+    
+    @GET
     @Path("/subresource/noproduces")
     Book getTheBookNoProduces() throws BookNotFoundFault;
     

Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSubresourceImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSubresourceImpl.java?rev=1240252&r1=1240251&r2=1240252&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSubresourceImpl.java
(original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSubresourceImpl.java
Fri Feb  3 17:34:33 2012
@@ -21,6 +21,8 @@ package org.apache.cxf.systest.jaxrs;
 
 import java.util.List;
 
+import javax.ws.rs.core.UriInfo;
+
 
 
 public class BookSubresourceImpl implements BookSubresource {
@@ -101,4 +103,9 @@ public class BookSubresourceImpl impleme
         return order;
     }
 
+    @Override
+    public Book getTheBookWithContext(UriInfo ui) throws BookNotFoundFault {
+        return getTheBook();
+    }
+
 }

Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java?rev=1240252&r1=1240251&r2=1240252&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
(original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
Fri Feb  3 17:34:33 2012
@@ -89,7 +89,7 @@ public class JAXRSSoapBookTest extends A
     @BeforeClass
     public static void startServers() throws Exception {
         assertTrue("server did not launch correctly", 
-                   launchServer(BookServerRestSoap.class, true));
+                   launchServer(BookServerRestSoap.class));
     }
     
     @Test
@@ -457,6 +457,18 @@ public class JAXRSSoapBookTest extends A
     }
     
     @Test
+    public void testGetBookSubresourceClientWithContext() throws Exception {
+        
+        String baseAddress = "http://localhost:" + PORT + "/test/services/rest";
+        BookStoreJaxrsJaxws proxy = JAXRSClientFactory.create(baseAddress,
+                                                                  BookStoreJaxrsJaxws.class);
+        BookSubresource bs = proxy.getBookSubresource("125");
+        Book b = bs.getTheBookWithContext(null);
+        assertEquals(125, b.getId());
+        assertEquals("CXF in Action", b.getName());
+    }
+    
+    @Test
     public void testGetBookSubresourceClientNoProduces() throws Exception {
         
         String baseAddress = "http://localhost:" + PORT + "/test/services/rest";



Mime
View raw message