You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2012/09/20 18:38:20 UTC

svn commit: r1388109 - in /cxf/branches/2.4.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/

Author: sergeyb
Date: Thu Sep 20 16:38:19 2012
New Revision: 1388109

URL: http://svn.apache.org/viewvc?rev=1388109&view=rev
Log:
Merged revisions 1388107 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.5.x-fixes

................
  r1388107 | sergeyb | 2012-09-20 17:35:20 +0100 (Thu, 20 Sep 2012) | 16 lines
  
  Merged revisions 1388104 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes
  
  ................
    r1388104 | sergeyb | 2012-09-20 17:31:58 +0100 (Thu, 20 Sep 2012) | 9 lines
    
    Merged revisions 1388096 via svnmerge from 
    https://svn.apache.org/repos/asf/cxf/trunk
    
    ........
      r1388096 | sergeyb | 2012-09-20 17:19:00 +0100 (Thu, 20 Sep 2012) | 1 line
      
      [CXF-4514] Updating JAX-RS client code to recognize bean enum properties
    ........
  ................
................

Modified:
    cxf/branches/2.4.x-fixes/   (props changed)
    cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
    cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
    cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/OrderBean.java

Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/branches/2.5.x-fixes:r1388107
  Merged /cxf/trunk:r1388096
  Merged /cxf/branches/2.6.x-fixes:r1388104

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

Modified: cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java?rev=1388109&r1=1388108&r2=1388109&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java (original)
+++ cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java Thu Sep 20 16:38:19 2012
@@ -1035,6 +1035,8 @@ public final class InjectionUtils {
                 }
                 if (isPrimitive(value.getClass())) {
                     values.putSingle(propertyName, value);
+                } else if (value.getClass().isEnum()) {
+                    values.putSingle(propertyName, value.toString());
                 } else if (isSupportedCollectionOrArray(value.getClass())) {
                     List<Object> theValues = null;
                     if (value.getClass().isArray()) {

Modified: cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java?rev=1388109&r1=1388108&r2=1388109&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java (original)
+++ cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java Thu Sep 20 16:38:19 2012
@@ -54,6 +54,8 @@ import org.apache.cxf.interceptor.FIStax
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.interceptor.Interceptor;
 import org.apache.cxf.interceptor.InterceptorProvider;
+import org.apache.cxf.interceptor.LoggingInInterceptor;
+import org.apache.cxf.interceptor.LoggingOutInterceptor;
 import org.apache.cxf.interceptor.transform.TransformInInterceptor;
 import org.apache.cxf.interceptor.transform.TransformOutInterceptor;
 import org.apache.cxf.io.CachedOutputStream;
@@ -512,12 +514,18 @@ public class JAXRSSoapBookTest extends A
         String baseAddress = "http://localhost:" + PORT + "/test/services/rest";
         BookStoreJaxrsJaxws proxy = JAXRSClientFactory.create(baseAddress,
                                                               BookStoreJaxrsJaxws.class);
+        
+        WebClient.getConfig(proxy).getOutInterceptors().add(new LoggingOutInterceptor());
+        WebClient.getConfig(proxy).getInInterceptors().add(new LoggingInInterceptor());
+        
         BookSubresource bs = proxy.getBookSubresource("139");
         OrderBean order = new OrderBean();
         order.setId(123L);
         order.setWeight(100);
+        order.setCustomerTitle(OrderBean.Title.MS);
         OrderBean order2 = bs.addOrder(order);
         assertEquals(Long.valueOf(123L), Long.valueOf(order2.getId()));
+        assertEquals(OrderBean.Title.MS, order2.getCustomerTitle());
     }
     
     @Test

Modified: cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/OrderBean.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/OrderBean.java?rev=1388109&r1=1388108&r2=1388109&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/OrderBean.java (original)
+++ cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/OrderBean.java Thu Sep 20 16:38:19 2012
@@ -25,6 +25,7 @@ public class OrderBean {
     
     private Long id;
     private int weight;
+    private Title customerTitle; 
     
     public void setId(Long id) {
         this.id = id;
@@ -38,4 +39,16 @@ public class OrderBean {
     public int getWeight() {
         return weight;
     }
+    
+    public Title getCustomerTitle() {
+        return customerTitle;
+    }
+    public void setCustomerTitle(Title customerTitle) {
+        this.customerTitle = customerTitle;
+    }
+
+    public static enum Title {
+        MR,
+        MS;
+    } 
 }