cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1053403 - in /cxf/branches/2.3.x-fixes: ./ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/ systests/jaxrs/src/test/resources/jaxrs_non_spring/WEB-INF/
Date Tue, 28 Dec 2010 18:04:49 GMT
Author: sergeyb
Date: Tue Dec 28 18:04:49 2010
New Revision: 1053403

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

........
  r1053402 | sergeyb | 2010-12-28 17:55:14 +0000 (Tue, 28 Dec 2010) | 1 line
  
  [JAX-RS]Adding a test with the user model using a header parameter
........

Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotations.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/resources.xml
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/resources/jaxrs_non_spring/WEB-INF/resources.xml

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Dec 28 18:04:49 2010
@@ -1 +1 @@
-/cxf/trunk:1041183,1041790,1041993,1042346,1042571,1042724,1042805,1042821,1043225,1043229,1043902,1043907,1043954,1044085,1044238-1044305,1045024,1048915,1048919,1048930,1049078,1049426,1049937,1050005,1050021,1050095,1050102,1050113,1050156,1050165,1050280,1051115,1051613,1051790,1051792,1052338,1052516,1052541,1052990,1052993-1052994,1052996-1052997,1053114,1053119,1053123,1053239,1053290
+/cxf/trunk:1041183,1041790,1041993,1042346,1042571,1042724,1042805,1042821,1043225,1043229,1043902,1043907,1043954,1044085,1044238-1044305,1045024,1048915,1048919,1048930,1049078,1049426,1049937,1050005,1050021,1050095,1050102,1050113,1050156,1050165,1050280,1051115,1051613,1051790,1051792,1052338,1052516,1052541,1052990,1052993-1052994,1052996-1052997,1053114,1053119,1053123,1053239,1053290,1053402

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

Modified: cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotations.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotations.java?rev=1053403&r1=1053402&r2=1053403&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotations.java
(original)
+++ cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotations.java
Tue Dec 28 18:04:49 2010
@@ -22,6 +22,9 @@ package org.apache.cxf.systest.jaxrs;
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Response;
+
 public class BookStoreNoAnnotations {
 
     private Map<Long, Book> books = new HashMap<Long, Book>();
@@ -47,4 +50,12 @@ public class BookStoreNoAnnotations {
         return ch2;
     }
     
+    public Book getBookWithAuthorization(Long id, String authorizationHeader) throws BookNotFoundFault
{
+        
+        if (authorizationHeader == null || !authorizationHeader.startsWith("Basic")) {
+            throw new WebApplicationException(Response.Status.FORBIDDEN);
+        }
+        
+        return books.get(id);
+    }
 }

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=1053403&r1=1053402&r2=1053403&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
Tue Dec 28 18:04:49 2010
@@ -29,6 +29,7 @@ import org.apache.commons.httpclient.met
 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.JAXRSClientFactoryBean;
 import org.apache.cxf.jaxrs.client.WebClient;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 
@@ -62,6 +63,23 @@ public class JAXRSClientServerNonSpringB
     }
     
     @Test
+    public void testGetBook123UserModelAuthorize() throws Exception {
+        JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
+        bean.setAddress("http://localhost:" + PORT + "/usermodel/bookstore/books");
+        bean.setUsername("Barry");
+        bean.setPassword("password");
+        bean.setModelRef("classpath:org/apache/cxf/systest/jaxrs/resources/resources.xml");
+        WebClient proxy = bean.createWebClient();
+        proxy.path("{id}/authorize", 123);
+        
+        Book book = proxy.get(Book.class);
+        assertEquals(123L, book.getId());
+        
+        
+        
+    }
+    
+    @Test
     public void testGetChapterUserModel() throws Exception {
         
         getAndCompareAsStrings("http://localhost:" + PORT + "/usermodel/bookstore/books/123/chapter",

Modified: cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/resources.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/resources.xml?rev=1053403&r1=1053402&r2=1053403&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/resources.xml
(original)
+++ cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/resources.xml
Tue Dec 28 18:04:49 2010
@@ -6,6 +6,10 @@
     </operation>
     <operation name="getBookChapter" path="/books/{id}/chapter">
         <param name="id" type="PATH"/>
+    </operation>
+    <operation name="getBookWithAuthorization" verb="GET" path="/books/{id}/authorize">
+        <param name="id" type="PATH"/>
+        <param name="authorization" type="HEADER"/>
     </operation> 
  </resource>
  <resource name="org.apache.cxf.systest.jaxrs.ChapterNoAnnotations">

Modified: cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/resources/jaxrs_non_spring/WEB-INF/resources.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/resources/jaxrs_non_spring/WEB-INF/resources.xml?rev=1053403&r1=1053402&r2=1053403&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/resources/jaxrs_non_spring/WEB-INF/resources.xml
(original)
+++ cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/resources/jaxrs_non_spring/WEB-INF/resources.xml
Tue Dec 28 18:04:49 2010
@@ -7,6 +7,10 @@
     <operation name="getBookChapter" path="/books/{id}/chapter">
         <param name="id" type="PATH"/>
     </operation> 
+    <operation name="getBookWithAuthorization" verb="GET" path="/books/{id}/authorize">
+        <param name="id" type="PATH"/>
+        <param name="authorization" type="HEADER"/>
+    </operation>
  </resource>
  <resource name="org.apache.cxf.systest.jaxrs.ChapterNoAnnotations">
     <operation name="getItself" verb="GET"/>



Mime
View raw message