cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r936001 - in /cxf/branches/2.2.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/ systests/jaxr...
Date Tue, 20 Apr 2010 17:15:47 GMT
Author: sergeyb
Date: Tue Apr 20 17:15:46 2010
New Revision: 936001

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

........
  r935995 | sergeyb | 2010-04-20 18:06:28 +0100 (Tue, 20 Apr 2010) | 1 line
  
  Fixing CXF JAXRS issue to do with Form beans processing and typo in ws/security/DefaultSecurityContext
........

Added:
    cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/OrderBean.java
      - copied unchanged from r935995, cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/OrderBean.java
Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/FormUtils.java
    cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/DefaultSecurityContext.java
    cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr 20 17:15:46 2010
@@ -1 +1 @@
-/cxf/trunk:935945
+/cxf/trunk:935945,935995

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

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java?rev=936001&r1=936000&r2=936001&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
Tue Apr 20 17:15:46 2010
@@ -382,7 +382,7 @@ public class ClientProxyImpl extends Abs
         List<Parameter> fm = getParameters(map, ParameterType.FORM);
         for (Parameter p : fm) {
             if (params[p.getIndex()] != null) {
-                FormUtils.addPropertyToForm(form, p.getName(), params[p.getIndex()].toString());
+                FormUtils.addPropertyToForm(form, p.getName(), params[p.getIndex()]);
             }
         }
         

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/FormUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/FormUtils.java?rev=936001&r1=936000&r2=936001&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/FormUtils.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/FormUtils.java
Tue Apr 20 17:15:46 2010
@@ -47,7 +47,7 @@ public final class FormUtils {
     
     public static void addPropertyToForm(MultivaluedMap<String, Object> map, String
name, Object value) {
         if (!"".equals(name)) {
-            map.add(name, value);
+            map.add(name, value.toString());
         } else {
             MultivaluedMap<String, Object> values = 
                 InjectionUtils.extractValuesFromBean(value, "");

Modified: cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/DefaultSecurityContext.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/DefaultSecurityContext.java?rev=936001&r1=936000&r2=936001&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/DefaultSecurityContext.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/DefaultSecurityContext.java
Tue Apr 20 17:15:46 2010
@@ -58,13 +58,13 @@ public class DefaultSecurityContext impl
         return false;
     }
 
-    private static boolean checkGroup(Group group, String role) {
+    protected boolean checkGroup(Group group, String role) {
         if (group.getName().equals(role)) {
             return true;
         }
             
         for (Enumeration<? extends Principal> members = group.members(); members.hasMoreElements();)
{
-            // this might be a plain role but could represent a group consisting of the pther
groups/roles
+            // this might be a plain role but could represent a group consisting of other
groups/roles
             Principal member = members.nextElement();
             if (member.getName().equals(role) 
                 || member instanceof Group && checkGroup((Group)member, role)) {

Modified: cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java?rev=936001&r1=936000&r2=936001&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
(original)
+++ cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
Tue Apr 20 17:15:46 2010
@@ -291,19 +291,35 @@ public class JAXRSSoapBookTest extends A
                                                               BookStoreJaxrsJaxws.class);
         BookSubresource bs = proxy.getBookSubresource("139");
         Book bean = new Book("CXF Rocks", 139L);
-        Book b = bs.getTheBook4(bean, bean, bean);
+        Book b = bs.getTheBook4(bean, bean, bean, bean);
         assertEquals(139, b.getId());
         assertEquals("CXF Rocks", b.getName());
     }
     
     @Test
+    public void testAddOrderFormBean() throws Exception {
+        
+        String baseAddress = "http://localhost:9092/test/services/rest";
+        BookStoreJaxrsJaxws proxy = JAXRSClientFactory.create(baseAddress,
+                                                              BookStoreJaxrsJaxws.class);
+        BookSubresource bs = proxy.getBookSubresource("139");
+        OrderBean order = new OrderBean();
+        order.setId(123L);
+        order.setWeight(100);
+        OrderBean order2 = bs.addOrder(order);
+        assertEquals(Long.valueOf(123L), Long.valueOf(order2.getId()));
+    }
+    
+    @Test
     public void testGetBookSubresourceWebClientParamExtensions() throws Exception {
         
         WebClient client = WebClient.create("http://localhost:9092/test/services/rest");
         client.type(MediaType.TEXT_PLAIN_TYPE).accept(MediaType.APPLICATION_XML_TYPE);
         client.path("/bookstore/books/139/subresource4/139/CXF Rocks");
         Book bean = new Book("CXF Rocks", 139L);
-        Book b = client.matrix("", bean).query("", bean).get(Book.class);
+        Form form = new Form();
+        form.set("name", "CXF Rocks").set("id", Long.valueOf(139L));
+        Book b = readBook((InputStream)client.matrix("", bean).query("", bean).form(form).getEntity());
         assertEquals(139, b.getId());
         assertEquals("CXF Rocks", b.getName());
     }



Mime
View raw message