Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4E067D67F for ; Thu, 20 Sep 2012 16:19:48 +0000 (UTC) Received: (qmail 44921 invoked by uid 500); 20 Sep 2012 16:19:48 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 44866 invoked by uid 500); 20 Sep 2012 16:19:48 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 44859 invoked by uid 99); 20 Sep 2012 16:19:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Sep 2012 16:19:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Sep 2012 16:19:45 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 542AE238899C; Thu, 20 Sep 2012 16:19:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1388096 - in /cxf/trunk: rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/ Date: Thu, 20 Sep 2012 16:19:01 -0000 To: commits@cxf.apache.org From: sergeyb@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120920161901.542AE238899C@eris.apache.org> Author: sergeyb Date: Thu Sep 20 16:19:00 2012 New Revision: 1388096 URL: http://svn.apache.org/viewvc?rev=1388096&view=rev Log: [CXF-4514] Updating JAX-RS client code to recognize bean enum properties Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/OrderBean.java Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java?rev=1388096&r1=1388095&r2=1388096&view=diff ============================================================================== --- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java (original) +++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java Thu Sep 20 16:19:00 2012 @@ -1023,6 +1023,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 theValues = null; if (value.getClass().isArray()) { 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=1388096&r1=1388095&r2=1388096&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 Thu Sep 20 16:19:00 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; @@ -532,12 +534,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/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/OrderBean.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/OrderBean.java?rev=1388096&r1=1388095&r2=1388096&view=diff ============================================================================== --- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/OrderBean.java (original) +++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/OrderBean.java Thu Sep 20 16:19:00 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; + } }