cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r522619 - in /incubator/cxf/trunk: integration/jbi/src/main/java/org/apache/cxf/jbi/transport/ rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/ rt/core/src/main/java/org/apache/cxf/service/ rt/core/src/main/java/org/apache/cxf/ws...
Date Mon, 26 Mar 2007 20:31:02 GMT
Author: dkulp
Date: Mon Mar 26 13:31:01 2007
New Revision: 522619

URL: http://svn.apache.org/viewvc?view=rev&rev=522619
Log:
First part of CXF-460
* Update wsdl parsing to return a List<ServiceInfo> instead of a single one.
* If more than one portType is used, more than one ServiceInfo is returned
* Still need to get the rest of the runtime/etc... to then select the correct one

Added:
    incubator/cxf/trunk/rt/core/src/test/resources/org/apache/cxf/wsdl11/hello_world_multiporttype.wsdl
  (with props)
Modified:
    incubator/cxf/trunk/integration/jbi/src/main/java/org/apache/cxf/jbi/transport/JBIConduitOutputStream.java
    incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/ServiceModelUtilTest.java
    incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapBindingFactoryTest.java
    incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/TestBase.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/ServiceModelVisitor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java
    incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/ServiceWSDLBuilderTest.java
    incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
    incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceConfigurationTest.java
    incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProviderTest.java
    incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java

Modified: incubator/cxf/trunk/integration/jbi/src/main/java/org/apache/cxf/jbi/transport/JBIConduitOutputStream.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/integration/jbi/src/main/java/org/apache/cxf/jbi/transport/JBIConduitOutputStream.java?view=diff&rev=522619&r1=522618&r2=522619
==============================================================================
--- incubator/cxf/trunk/integration/jbi/src/main/java/org/apache/cxf/jbi/transport/JBIConduitOutputStream.java
(original)
+++ incubator/cxf/trunk/integration/jbi/src/main/java/org/apache/cxf/jbi/transport/JBIConduitOutputStream.java
Mon Mar 26 13:31:01 2007
@@ -94,8 +94,8 @@
             if (target != null) {
                 serviceName = EndpointReferenceUtils.getServiceName(target);
             } else {
-                serviceName = message.getExchange().get(org.apache.cxf.service.Service.class).
-                getServiceInfo().getName();
+                serviceName = message.getExchange().get(org.apache.cxf.service.Service.class)
+                    .getName();
             }
 
             

Modified: incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/ServiceModelUtilTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/ServiceModelUtilTest.java?view=diff&rev=522619&r1=522618&r2=522619
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/ServiceModelUtilTest.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/ServiceModelUtilTest.java
Mon Mar 26 13:31:01 2007
@@ -81,7 +81,7 @@
         expect(bus.getExtension(DestinationFactoryManager.class)).andStubReturn(dfm);
 
         control.replay();
-        serviceInfo = wsdlServiceBuilder.buildService(def, service);
+        serviceInfo = wsdlServiceBuilder.buildServices(def, service).get(0);
     }
     
     public void tearDown() throws Exception {

Modified: incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapBindingFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapBindingFactoryTest.java?view=diff&rev=522619&r1=522618&r2=522619
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapBindingFactoryTest.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapBindingFactoryTest.java
Mon Mar 26 13:31:01 2007
@@ -88,7 +88,8 @@
 
         WSDLServiceBuilder builder = new WSDLServiceBuilder(bus);
         ServiceInfo serviceInfo = builder
-            .buildService(d, new QName("http://apache.org/hello_world_soap_http", "SOAPService"));
+            .buildServices(d, new QName("http://apache.org/hello_world_soap_http", "SOAPService"))
+            .get(0);
 
         BindingInfo bi = serviceInfo.getBindings().iterator().next();
 
@@ -132,7 +133,8 @@
 
         WSDLServiceBuilder builder = new WSDLServiceBuilder(bus);
         ServiceInfo serviceInfo = builder
-            .buildService(d, new QName("http://apache.org/hello_world_soap12_http", "SOAPService"));
+            .buildServices(d, new QName("http://apache.org/hello_world_soap12_http", "SOAPService"))
+            .get(0);
 
         BindingInfo bi = serviceInfo.getBindings().iterator().next();
 

Modified: incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/TestBase.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/TestBase.java?view=diff&rev=522619&r1=522618&r2=522619
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/TestBase.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/TestBase.java
Mon Mar 26 13:31:01 2007
@@ -132,7 +132,7 @@
         EasyMock.expect(bus.getExtension(DestinationFactoryManager.class)).andStubReturn(dfm);
         control.replay();
 
-        ServiceInfo serviceInfo = wsdlServiceBuilder.buildService(def, service);
+        ServiceInfo serviceInfo = wsdlServiceBuilder.buildServices(def, service).get(0);
         serviceInfo.setProperty(WSDLServiceBuilder.WSDL_DEFINITION, null);
         serviceInfo.setProperty(WSDLServiceBuilder.WSDL_SERVICE, null);
         return serviceInfo;

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/ServiceModelVisitor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/ServiceModelVisitor.java?view=diff&rev=522619&r1=522618&r2=522619
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/ServiceModelVisitor.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/ServiceModelVisitor.java
Mon Mar 26 13:31:01 2007
@@ -31,7 +31,7 @@
  *
  */
 public class ServiceModelVisitor {
-    private ServiceInfo serviceInfo;
+    protected ServiceInfo serviceInfo;
     
     public ServiceModelVisitor(ServiceInfo serviceInfo) {
         super();

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java?view=diff&rev=522619&r1=522618&r2=522619
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
Mon Mar 26 13:31:01 2007
@@ -23,6 +23,7 @@
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -126,7 +127,7 @@
     }
 
 
-    public List<ServiceInfo> buildService(Definition d) {
+    public List<ServiceInfo> buildServices(Definition d) {
         DescriptionInfo description = new DescriptionInfo();
         description.setProperty(WSDL_DEFINITION, d);
         description.setName(d.getQName());
@@ -138,24 +139,24 @@
         for (java.util.Iterator<QName> ite =
                 CastUtils.cast(d.getServices().keySet().iterator()); ite.hasNext();) {
             QName qn = ite.next();
-            serviceList.add(buildService(d, qn, description));
+            serviceList.addAll(buildServices(d, qn, description));
         }
         return serviceList;
     }
 
     
     
-    public ServiceInfo buildService(Definition d, QName name) {
-        return buildService(d, name, null);
+    public List<ServiceInfo> buildServices(Definition d, QName name) {
+        return buildServices(d, name, null);
     }
 
-    private ServiceInfo buildService(Definition d, QName name, DescriptionInfo description)
{
+    private List<ServiceInfo> buildServices(Definition d, QName name, DescriptionInfo
description) {
         Service service = d.getService(name);
-        return buildService(d, service, description);
+        return buildServices(d, service, description);
     }
 
-    public ServiceInfo buildService(Definition def, Service serv) {
-        return buildService(def, serv, null);
+    public List<ServiceInfo> buildServices(Definition def, Service serv) {
+        return buildServices(def, serv, null);
     }
     
     
@@ -199,7 +200,9 @@
     }
     
  
-    private ServiceInfo buildService(Definition def, Service serv, DescriptionInfo d) {
+    private List<ServiceInfo> buildServices(Definition def, Service serv, DescriptionInfo
d) {
+        Map<QName, ServiceInfo> services = new LinkedHashMap<QName, ServiceInfo>();
+        
         DescriptionInfo description = d;
         if (null == description) {
             description = new DescriptionInfo();
@@ -209,32 +212,30 @@
             copyExtensors(description, def.getExtensibilityElements());
             copyExtensionAttributes(description, def);
         }
-        ServiceInfo service = new ServiceInfo();
-        service.setDescription(description);
-        description.getDescribed().add(service);
-        service.setProperty(WSDL_DEFINITION, def);
-        service.setProperty(WSDL_SERVICE, serv);
-
-        XmlSchemaCollection schemas = getSchemas(def, service);
-        service.setProperty(WSDL_SCHEMA_ELEMENT_LIST, this.schemaList);
-        service.setProperty(WSDL_SCHEMA_LIST, schemas);
-        service.setTargetNamespace(def.getTargetNamespace());
-        service.setName(serv.getQName());
-        copyExtensors(service, serv.getExtensibilityElements());
-        copyExtensionAttributes(service, serv);
-
-        PortType portType = null;
-        for (Port port : cast(serv.getPorts().values(), Port.class)) {
-            if (portType == null) {
-                portType = port.getBinding().getPortType();
-            } else if (port.getBinding().getPortType() != portType) {
-                throw new IllegalStateException("All endpoints must share the same portType");
-            }
-        }
-
-        buildInterface(service, portType);
+        
         for (Port port : cast(serv.getPorts().values(), Port.class)) {
             Binding binding = port.getBinding();
+            PortType pt = binding.getPortType();
+            ServiceInfo service = services.get(pt.getQName());
+            if (service == null) {
+                service = new ServiceInfo();
+                service.setDescription(description);
+                description.getDescribed().add(service);
+                service.setProperty(WSDL_DEFINITION, def);
+                service.setProperty(WSDL_SERVICE, serv);
+
+                XmlSchemaCollection schemas = getSchemas(def, service);
+                service.setProperty(WSDL_SCHEMA_ELEMENT_LIST, this.schemaList);
+                service.setProperty(WSDL_SCHEMA_LIST, schemas);
+                service.setTargetNamespace(def.getTargetNamespace());
+                service.setName(serv.getQName());
+                copyExtensors(service, serv.getExtensibilityElements());
+                copyExtensionAttributes(service, serv);
+                
+                buildInterface(service, pt);
+                
+                services.put(pt.getQName(), service);
+            }
 
             BindingInfo bi = service.getBinding(binding.getQName());
             if (bi == null) {
@@ -243,7 +244,7 @@
             buildEndpoint(service, bi, port);
         }
 
-        return service;
+        return new ArrayList<ServiceInfo>(services.values());
     }
 
     private XmlSchemaCollection getSchemas(Definition def, ServiceInfo serviceInfo) {

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java?view=diff&rev=522619&r1=522618&r2=522619
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java
Mon Mar 26 13:31:01 2007
@@ -76,10 +76,11 @@
     public Service create() {
         ServiceInfo serviceInfo;
         if (serviceName == null) {
-            List<ServiceInfo> services = new WSDLServiceBuilder(getBus()).buildService(definition);
+            List<ServiceInfo> services = new WSDLServiceBuilder(getBus()).buildServices(definition);
             if (services.size() == 0) {
                 throw new ServiceConstructionException(new Message("NO_SERVICE_EXC", LOG));
             } else {
+                //@@TODO  - this isn't good, need to return all the services
                 serviceInfo = services.get(0);
                 serviceName = serviceInfo.getName();
             }
@@ -88,7 +89,7 @@
             if (wsdlService == null) {
                 throw new ServiceConstructionException(new Message("NO_SUCH_SERVICE_EXC",
LOG, serviceName));
             }
-            serviceInfo = new WSDLServiceBuilder(getBus()).buildService(definition, wsdlService);
+            serviceInfo = new WSDLServiceBuilder(getBus()).buildServices(definition, wsdlService).get(0);
         }
         ServiceImpl service = new ServiceImpl(serviceInfo);
         setService(service);

Modified: incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/ServiceWSDLBuilderTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/ServiceWSDLBuilderTest.java?view=diff&rev=522619&r1=522618&r2=522619
==============================================================================
--- incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/ServiceWSDLBuilderTest.java
(original)
+++ incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/ServiceWSDLBuilderTest.java
Mon Mar 26 13:31:01 2007
@@ -96,7 +96,7 @@
 
         control.replay();
         
-        serviceInfo = wsdlServiceBuilder.buildService(def, service);
+        serviceInfo = wsdlServiceBuilder.buildServices(def, service).get(0);
         serviceInfo.setProperty(WSDLServiceBuilder.WSDL_DEFINITION, null);
         serviceInfo.setProperty(WSDLServiceBuilder.WSDL_SERVICE, null);
         newDef = new ServiceWSDLBuilder(serviceInfo).build();

Modified: incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java?view=diff&rev=522619&r1=522618&r2=522619
==============================================================================
--- incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
(original)
+++ incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
Mon Mar 26 13:31:01 2007
@@ -22,6 +22,7 @@
 import java.io.File;
 import java.io.FileOutputStream;
 import java.net.URI;
+import java.net.URL;
 import java.net.URLDecoder;
 import java.net.URLEncoder;
 import java.util.Collection;
@@ -41,8 +42,6 @@
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
-import junit.framework.TestCase;
-
 import org.apache.cxf.Bus;
 import org.apache.cxf.binding.BindingFactoryManager;
 import org.apache.cxf.helpers.CastUtils;
@@ -66,13 +65,17 @@
 import org.apache.ws.commons.schema.XmlSchemaElement;
 import org.easymock.classextension.EasyMock;
 import org.easymock.classextension.IMocksControl;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
 
-public class WSDLServiceBuilderTest extends TestCase {
+public class WSDLServiceBuilderTest extends Assert {
     // TODO: reuse the wsdl in testutils and add the parameter order into one of the wsdl
     private static final Logger LOG = Logger.getLogger(WSDLServiceBuilderTest.class.getName());
     private static final String WSDL_PATH = "hello_world.wsdl";
     private static final String BARE_WSDL_PATH = "hello_world_bare.wsdl";
     private static final String IMPORT_WSDL_PATH = "hello_world_schema_import.wsdl";
+    private static final String MULTIPORT_WSDL_PATH = "hello_world_multiporttype.wsdl";
     
     private static final String EXTENSION_NAMESPACE = "http://cxf.apache.org/extension/ns";
     private static final QName EXTENSION_ATTR_BOOLEAN = new QName(EXTENSION_NAMESPACE, "booleanAttr");
@@ -84,6 +87,7 @@
     private Service service;
 
     private ServiceInfo serviceInfo;
+    private List<ServiceInfo> serviceInfos;
 
     private IMocksControl control;
 
@@ -93,14 +97,15 @@
 
     private DestinationFactoryManager destinationFactoryManager;
 
+    @Before
     public void setUp() throws Exception {
         setUpWSDL(WSDL_PATH, 0);
     }
 
-
-    
     private void setUpWSDL(String wsdl, int serviceSeq) throws Exception {
-        String wsdlUrl = getClass().getResource(wsdl).toString();
+        URL url = getClass().getResource(wsdl);
+        assertNotNull("could not find wsdl " + wsdl, url);
+        String wsdlUrl = url.toString();
         LOG.info("the path of wsdl file is " + wsdlUrl);
         WSDLFactory wsdlFactory = WSDLFactory.newInstance();
         WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
@@ -108,7 +113,6 @@
         
         def = wsdlReader.readWSDL(new WSDLLocatorImpl(wsdlUrl));
 
-        WSDLServiceBuilder wsdlServiceBuilder = new WSDLServiceBuilder(bus);
         int seq = 0;
         for (Service serv : CastUtils.cast(def.getServices().values(), Service.class)) {
             if (serv != null) {
@@ -125,22 +129,28 @@
         bus = control.createMock(Bus.class);
         bindingFactoryManager = control.createMock(BindingFactoryManager.class);
         destinationFactoryManager = control.createMock(DestinationFactoryManager.class);
-        wsdlServiceBuilder = new WSDLServiceBuilder(bus);
+        WSDLServiceBuilder wsdlServiceBuilder = new WSDLServiceBuilder(bus);
 
         EasyMock.expect(bus.getExtension(BindingFactoryManager.class))
             .andReturn(bindingFactoryManager).anyTimes();
-        EasyMock.expect(bus.getExtension(DestinationFactoryManager.class)).andReturn(
-                destinationFactoryManager);
+        
+        EasyMock.expect(bus.getExtension(DestinationFactoryManager.class))
+            .andReturn(destinationFactoryManager).atLeastOnce();
 
         control.replay();
-        serviceInfo = wsdlServiceBuilder.buildService(def, service);
+        serviceInfos = wsdlServiceBuilder.buildServices(def, service);
+        serviceInfo = serviceInfos.get(0);
 
     }
 
-    public void tearDown() throws Exception {
+    @Test
+    public void testMultiPorttype() throws Exception {
+        setUpWSDL(MULTIPORT_WSDL_PATH, 0);
+        assertEquals(2, serviceInfos.size());
         control.verify();
     }
 
+    @Test
     public void testServiceInfo() throws Exception {
         assertEquals("SOAPService", serviceInfo.getName().getLocalPart());
         assertEquals("http://apache.org/hello_world_soap_http", serviceInfo.getName().getNamespaceURI());
@@ -154,12 +164,16 @@
         assertNotNull(ei);
         assertEquals("http://schemas.xmlsoap.org/wsdl/soap/", ei.getTransportId());
         assertNotNull(ei.getBinding());
+        control.verify();
     }
 
+    @Test
     public void testInterfaceInfo() throws Exception {
         assertEquals("Greeter", serviceInfo.getInterface().getName().getLocalPart());
+        control.verify();
     }
 
+    @Test
     public void testOperationInfo() throws Exception {
         QName name = new QName(serviceInfo.getName().getNamespaceURI(), "sayHi");
         assertEquals(serviceInfo.getInterface().getOperations().size(), 4);
@@ -233,8 +247,10 @@
         assertTrue(pingMe.hasOutput());
 
         assertNull(serviceInfo.getInterface().getOperation(new QName("what ever")));
+        control.verify();
     }
 
+    @Test
     public void testBindingInfo() throws Exception {
         BindingInfo bindingInfo = null;
         assertEquals(1, serviceInfo.getBindings().size());
@@ -243,8 +259,10 @@
         assertEquals(bindingInfo.getInterface().getName().getLocalPart(), "Greeter");
         assertEquals(bindingInfo.getName().getLocalPart(), "Greeter_SOAPBinding");
         assertEquals(bindingInfo.getName().getNamespaceURI(), "http://apache.org/hello_world_soap_http");
+        control.verify();
     }
 
+    @Test
     public void testBindingOperationInfo() throws Exception {
         BindingInfo bindingInfo = null;
         bindingInfo = serviceInfo.getBindings().iterator().next();
@@ -272,8 +290,10 @@
         BindingOperationInfo pingMe = bindingInfo.getOperation(name);
         assertNotNull(pingMe);
         assertEquals(pingMe.getName(), name);
+        control.verify();
     }
 
+    @Test
     public void testBindingMessageInfo() throws Exception {
         BindingInfo bindingInfo = null;
         bindingInfo = serviceInfo.getBindings().iterator().next();
@@ -328,8 +348,10 @@
         elementName = fault.getFaultInfo().getMessageParts().get(0).getElementQName();
         assertEquals(elementName.getLocalPart(), "faultDetail");
         assertEquals(elementName.getNamespaceURI(), "http://apache.org/hello_world_soap_http/types");
+        control.verify();
     }
 
+    @Test
     public void testSchema() {
         XmlSchemaCollection schemas = serviceInfo.getProperty(WSDLServiceBuilder.WSDL_SCHEMA_LIST,
                 XmlSchemaCollection.class);
@@ -344,8 +366,10 @@
         // with schema in serviceInfo
         Schema schema = EndpointReferenceUtils.getSchema(serviceInfo);
         assertNotNull(schema);
+        control.verify();
     }
 
+    @Test
     public void testBare() throws Exception {
         setUpWSDL(BARE_WSDL_PATH, 0);
         BindingInfo bindingInfo = null;
@@ -361,8 +385,10 @@
         assertFalse("greetMe should be a Unwrapped operation ", greetMe.isUnwrappedCapable());
         
         assertNotNull(serviceInfo.getXmlSchemaCollection());
+        control.verify();
     }
 
+    @Test
     public void testImport() throws Exception {
         // rewrite the schema1.xsd to import schema2.xsd with absolute path.
         DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
@@ -404,14 +430,17 @@
         assertNotNull(ele);
         Schema schema = EndpointReferenceUtils.getSchema(serviceInfo);        
         assertNotNull(schema);        
+        control.verify();
     }
 
     
+    @Test
     public void testDiffPortTypeNsImport() throws Exception {
         setUpWSDL("/DiffPortTypeNs.wsdl", 0);        
         doDiffPortTypeNsImport();
         setUpWSDL("/DiffPortTypeNs.wsdl", 1);
         doDiffPortTypeNsImport();
+        control.verify();
     }
     
     private void doDiffPortTypeNsImport() {
@@ -432,6 +461,7 @@
         }
     }
     
+    @Test
     public void testParameterOrder() throws Exception {
         String ns = "http://apache.org/hello_world_xml_http/bare";
         setUpWSDL("hello_world_xml_bare.wsdl", 0);
@@ -468,9 +498,11 @@
         assertEquals(3, parts.size());
         assertEquals("in3", parts.get(0).getName().getLocalPart());
         assertEquals("in1", parts.get(1).getName().getLocalPart());
-        assertEquals("in2", parts.get(2).getName().getLocalPart());        
+        assertEquals("in2", parts.get(2).getName().getLocalPart());
+        control.verify();
     }
     
+    @Test
     public void testParameterOrder2() throws Exception {
         setUpWSDL("header2.wsdl", 0);
         String ns = "http://apache.org/header2";
@@ -481,8 +513,10 @@
         assertEquals(2, parts.size());
         assertEquals("header_info", parts.get(0).getName().getLocalPart());
         assertEquals("the_request", parts.get(1).getName().getLocalPart());
+        control.verify();        
     }
 
+    @Test
     public void testExtensions() throws Exception {
         setUpWSDL("hello_world_ext.wsdl", 0);
 
@@ -547,6 +581,8 @@
   
         assertBindingOperationMessageExtensions(boi, true, true, faultName);
         assertBindingOperationMessageExtensions(bi.getOperation(greetMeOpName), false, true,
null);
+        control.verify();
+        
     }
 
     private void assertPortTypeOperationExtensions(OperationInfo oi, boolean expectExtensions)
{

Added: incubator/cxf/trunk/rt/core/src/test/resources/org/apache/cxf/wsdl11/hello_world_multiporttype.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/test/resources/org/apache/cxf/wsdl11/hello_world_multiporttype.wsdl?view=auto&rev=522619
==============================================================================
--- incubator/cxf/trunk/rt/core/src/test/resources/org/apache/cxf/wsdl11/hello_world_multiporttype.wsdl
(added)
+++ incubator/cxf/trunk/rt/core/src/test/resources/org/apache/cxf/wsdl11/hello_world_multiporttype.wsdl
Mon Mar 26 13:31:01 2007
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<definitions name="HelloWorldService" 
+    targetNamespace="http://cxf.apache.org/test/hello_world_multi" 
+    xmlns="http://schemas.xmlsoap.org/wsdl/" 
+    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
+    xmlns:tns="http://cxf.apache.org/test/hello_world_multi" 
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+
+    <message name="greetMe">
+        <part name="stringParam0" type="xsd:string"/>
+    </message>
+    <message name="greetMeResponse">
+        <part name="return" type="xsd:string"/>
+    </message>
+    
+    <message name="greetMe2">
+        <part name="stringParam0" type="xsd:string"/>
+    </message>
+    <message name="greetMe2Response">
+        <part name="return" type="xsd:string"/>
+    </message>    
+    
+    <portType name="HelloWorldPortType">
+        <operation name="greetMe">
+            <input message="tns:greetMe" name="greetMe"/>
+            <output message="tns:greetMeResponse" name="greetMeResponse"/>
+        </operation>
+    </portType>
+    <portType name="HelloWorldPortType2">
+        <operation name="greetMe2">
+            <input message="tns:greetMe2" name="greetMe2"/>
+            <output message="tns:greetMe2Response" name="greetMe2Response"/>
+        </operation>
+    </portType>
+
+       
+    <binding name="HelloWorldBinding" type="tns:HelloWorldPortType">
+        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <operation name="greetMe">
+            <soap:operation soapAction="" style="rpc"/>
+            <input name="greetMe">
+                <soap:body 
+                    namespace="http://cxf.apache.org/test/hello_world_multi" use="literal"/>
+            </input>
+            <output name="greetMeResponse">
+                <soap:body  
+                    namespace="http://cxf.apache.org/test/hello_world_multi" use="literal"/>
+            </output>
+        </operation>
+    </binding>    
+    <binding name="HelloWorldBinding2" type="tns:HelloWorldPortType2">
+        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <operation name="greetMe2">
+            <soap:operation soapAction="" style="rpc"/>
+            <input name="greetMe2">
+                <soap:body 
+                    namespace="http://cxf.apache.org/test/hello_world_multi" use="literal"/>
+            </input>
+            <output name="greetMe2Response">
+                <soap:body  
+                    namespace="http://cxf.apache.org/test/hello_world_multi" use="literal"/>
+            </output>
+        </operation>
+    </binding>    
+        
+    <service name="HelloWorldService">
+        <port binding="tns:HelloWorldBinding" name="HelloWorldPort">
+		    <soap:address location="http://localhost:9000/SoapContext/SoapPort"/>       
    
+        </port>
+        <port binding="tns:HelloWorldBinding2" name="HelloWorldPort2">
+		    <soap:address location="http://localhost:9000/SoapContext/SoapPort"/>       
    
+        </port>
+    </service>
+       
+</definitions>
+
+

Propchange: incubator/cxf/trunk/rt/core/src/test/resources/org/apache/cxf/wsdl11/hello_world_multiporttype.wsdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/core/src/test/resources/org/apache/cxf/wsdl11/hello_world_multiporttype.wsdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/core/src/test/resources/org/apache/cxf/wsdl11/hello_world_multiporttype.wsdl
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java?view=diff&rev=522619&r1=522618&r2=522619
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java
(original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java
Mon Mar 26 13:31:01 2007
@@ -104,7 +104,7 @@
             }
         }
         
-        serviceInfo = wsdlServiceBuilder.buildService(def, service);
+        serviceInfo = wsdlServiceBuilder.buildServices(def, service).get(0);
         List<String> schemas = new ArrayList<String>();
 
         String schema1 = getClass().getResource(SCHEMA1).toString();

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceConfigurationTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceConfigurationTest.java?view=diff&rev=522619&r1=522618&r2=522619
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceConfigurationTest.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceConfigurationTest.java
Mon Mar 26 13:31:01 2007
@@ -97,7 +97,7 @@
         EasyMock.expect(bus.getExtension(DestinationFactoryManager.class)).andStubReturn(dfm);
         control.replay();
 
-        ServiceInfo serviceInfo = wsdlServiceBuilder.buildService(def, service);
+        ServiceInfo serviceInfo = wsdlServiceBuilder.buildServices(def, service).get(0);
         serviceInfo.setProperty(WSDLServiceBuilder.WSDL_DEFINITION, null);
         serviceInfo.setProperty(WSDLServiceBuilder.WSDL_SERVICE, null);
         return serviceInfo;

Modified: incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProviderTest.java?view=diff&rev=522619&r1=522618&r2=522619
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProviderTest.java
(original)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProviderTest.java
Mon Mar 26 13:31:01 2007
@@ -93,7 +93,7 @@
             String resourceName = "/attachment/wsdl11/test" + i + ".wsdl";
             URL url = Wsdl11AttachmentPolicyProviderTest.class.getResource(resourceName);
      
             try {
-                services[i] = builder.buildService(manager.getDefinition(url)).get(0);
+                services[i] = builder.buildServices(manager.getDefinition(url)).get(0);
             } catch (WSDLException ex) {
                 ex.printStackTrace();
                 fail("Failed to build service from resource " + resourceName);

Modified: incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java?view=diff&rev=522619&r1=522618&r2=522619
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
(original)
+++ incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
Mon Mar 26 13:31:01 2007
@@ -136,11 +136,11 @@
                 String serviceName = (String)context.get(ToolConstants.CFG_SERVICENAME);
 
                 if (serviceName != null) {
-                    ServiceInfo service = serviceBuilder
-                        .buildService(definition, getServiceQName(definition));
-                    serviceList.add(service);
+                    List<ServiceInfo> services = serviceBuilder
+                        .buildServices(definition, getServiceQName(definition));
+                    serviceList.addAll(services);
                 } else  if (definition.getServices().size() > 0) {
-                    serviceList = serviceBuilder.buildService(definition);
+                    serviceList = serviceBuilder.buildServices(definition);
                 } else  {
                     serviceList = serviceBuilder.buildMockServices(definition);
                 }



Mime
View raw message