cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1127464 - in /cxf/branches/2.3.x-fixes: ./ systests/databinding/src/test/java/org/apache/cxf/systest/aegis/
Date Wed, 25 May 2011 10:22:57 GMT
Author: ffang
Date: Wed May 25 10:22:57 2011
New Revision: 1127464

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

........
  r1127459 | ffang | 2011-05-25 18:12:26 +0800 (δΈ‰, 25  5 2011) | 1 line
  
  [CXF-3526]add testcase to demostrate how to use inherited nested map
........

Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisClientServerTest.java
    cxf/branches/2.3.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/SportsService.java
    cxf/branches/2.3.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/SportsServiceImpl.java

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

Modified: cxf/branches/2.3.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisClientServerTest.java?rev=1127464&r1=1127463&r2=1127464&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisClientServerTest.java
(original)
+++ cxf/branches/2.3.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisClientServerTest.java
Wed May 25 10:22:57 2011
@@ -24,6 +24,7 @@ import java.lang.reflect.Method;
 import java.net.URL;
 import java.util.Collection;
 import java.util.List;
+import java.util.Map;
 import java.util.logging.Logger;
 
 import org.w3c.dom.Document;
@@ -36,6 +37,8 @@ import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.endpoint.dynamic.DynamicClientFactory;
 import org.apache.cxf.frontend.ClientProxyFactoryBean;
 import org.apache.cxf.helpers.XMLUtils;
+import org.apache.cxf.interceptor.LoggingInInterceptor;
+import org.apache.cxf.interceptor.LoggingOutInterceptor;
 import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
 import org.apache.cxf.test.TestUtilities;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
@@ -145,6 +148,8 @@ public class AegisClientServerTest exten
         proxyFactory.setDataBinding(aegisBinding);
         proxyFactory.setServiceClass(SportsService.class);
         proxyFactory.setWsdlLocation("http://localhost:" + PORT + "/jaxwsAndAegisSports?wsdl");
+        proxyFactory.getInInterceptors().add(new LoggingInInterceptor());
+        proxyFactory.getOutInterceptors().add(new LoggingOutInterceptor());
         SportsService service = (SportsService) proxyFactory.create();
 
         Collection<Team> teams = service.getTeams();
@@ -157,6 +162,24 @@ public class AegisClientServerTest exten
     }
     
     @Test
+    public void testComplexMapResult() throws Exception {
+        AegisDatabinding aegisBinding = new AegisDatabinding();
+        JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
+        proxyFactory.setDataBinding(aegisBinding);
+        proxyFactory.setServiceClass(SportsService.class);
+        proxyFactory.setAddress("http://localhost:" + PORT + "/jaxwsAndAegisSports");
+        proxyFactory.getInInterceptors().add(new LoggingInInterceptor());
+        proxyFactory.getOutInterceptors().add(new LoggingOutInterceptor());
+        SportsService service = (SportsService) proxyFactory.create();
+        Map<String, Map<Integer, Integer>> result = service.testComplexMapResult();
+        assertEquals(result.size(), 1);
+        assertTrue(result.containsKey("key1"));
+        assertNotNull(result.get("key1"));
+        assertEquals(result.toString(), "{key1={1=3}}");
+    }
+    
+          
+    @Test
     public void testDynamicClient() throws Exception {
         DynamicClientFactory dcf = DynamicClientFactory.newInstance();
         Client client = dcf.createClient("http://localhost:" + PORT + "/jaxwsAndAegisSports?wsdl");

Modified: cxf/branches/2.3.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/SportsService.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/SportsService.java?rev=1127464&r1=1127463&r2=1127464&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/SportsService.java
(original)
+++ cxf/branches/2.3.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/SportsService.java
Wed May 25 10:22:57 2011
@@ -20,15 +20,27 @@
 package org.apache.cxf.systest.aegis;
 
 import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
 
 import javax.jws.WebService;
 
 @WebService(targetNamespace = "http://cxf.apache.org/systest/aegis/sports")
 public interface SportsService {
     Collection<Team> getTeams();
-    
+
     String testForMinOccurs0(String a, Integer b, String c);
+
     AttributeBean getAttributeBean();
+
     BeanWithCharacter getCharBean();
-}
 
+    public class CustomerMap extends HashMap<String, Map<Integer, Integer>> {
+        private static final long serialVersionUID = 6235169270166551322L;
+    }
+
+    public class SimpleMapResult extends HashMap<String, Integer> {
+    }
+
+    Map<String, Map<Integer, Integer>> testComplexMapResult();
+}

Modified: cxf/branches/2.3.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/SportsServiceImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/SportsServiceImpl.java?rev=1127464&r1=1127463&r2=1127464&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/SportsServiceImpl.java
(original)
+++ cxf/branches/2.3.x-fixes/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/SportsServiceImpl.java
Wed May 25 10:22:57 2011
@@ -21,7 +21,10 @@ package org.apache.cxf.systest.aegis;
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
+
 
 /**
  * 
@@ -46,5 +49,16 @@ public class SportsServiceImpl implement
     public BeanWithCharacter getCharBean() {
         return new BeanWithCharacter();
     }
+    
+   
+    public Map<String, Map<Integer, Integer>> testComplexMapResult() {
+        CustomerMap result 
+            = new CustomerMap();
+        Map<Integer, Integer> map1 = new HashMap<Integer, Integer>();
+        map1.put(1, 3);
+        result.put("key1", map1);
+        return result;
 
+    }
+      
 }



Mime
View raw message