cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r890633 - /cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ServerFactoryTest.java
Date Tue, 15 Dec 2009 04:01:25 GMT
Author: dkulp
Date: Tue Dec 15 04:01:25 2009
New Revision: 890633

URL: http://svn.apache.org/viewvc?rev=890633&view=rev
Log:
[CXF-1758] Add test case in simple frontend as well

Modified:
    cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ServerFactoryTest.java

Modified: cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ServerFactoryTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ServerFactoryTest.java?rev=890633&r1=890632&r2=890633&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ServerFactoryTest.java
(original)
+++ cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ServerFactoryTest.java
Tue Dec 15 04:01:25 2009
@@ -27,6 +27,7 @@
 import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.endpoint.ServerImpl;
 import org.apache.cxf.frontend.ServerFactoryBean;
+import org.apache.cxf.helpers.XMLUtils;
 import org.apache.cxf.jaxb.JAXBDataBinding;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.service.model.EndpointInfo;
@@ -55,8 +56,32 @@
         assertTrue(server.getDestination() instanceof CustomDestination);
     }
     
-        
-    @SuppressWarnings("unchecked")
+    public static interface TestService<P> {
+        int open(P args);
+        void close(int handle);
+    }
+
+    public static class TestServiceImpl<P> implements TestService<P> {
+        public void close(int handle) {
+        }
+
+        public int open(P args) { 
+            return 0;
+        }
+    }
+    
+    @Test
+    public void testCXF1758() throws Exception {
+        ServerFactoryBean svrBean = new ServerFactoryBean();
+        svrBean.setAddress("http://localhost/Generics");
+        svrBean.setServiceBean(new TestServiceImpl<String>() { });
+        svrBean.setBus(getBus());
+        ServerImpl server = (ServerImpl)svrBean.create();
+        //XMLUtils.printDOM(getWSDLDocument(server));
+        assertValid("//xsd:schema/xsd:complexType[@name='open']/xsd:sequence/"
+                    + "xsd:element[@type='xsd:string']",
+                    getWSDLDocument(server));
+    }
     @Test
     public void testJaxbExtraClass() throws Exception {
         ServerFactoryBean svrBean = new ServerFactoryBean();
@@ -64,7 +89,7 @@
         svrBean.setServiceClass(HelloServiceImpl.class);
         svrBean.setBus(getBus());
 
-        Map props = svrBean.getProperties();
+        Map<String, Object> props = svrBean.getProperties();
         if (props == null) {
             props = new HashMap<String, Object>();
         }



Mime
View raw message