From d40b0336415c3b79b9e8a5d0e198ca974b640129 Mon Sep 17 00:00:00 2001 From: slaws Date: Sat, 24 Mar 2012 10:15:46 +0000 Subject: TUSCANY-4036 - Create unique names in WSDL when multiple components expose the same service interface. Thanks for the patch Greg git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1304746 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tuscany/sca/itest/builder/BuilderTestCase.java | 2 +- .../tuscany/sca/binding/ws/axis2/QuestionMarkWSDLTestCase.java | 2 +- .../itest/ws/wsdlgen/src/test/java/datatypes/BaseFramework.java | 8 ++++---- .../ws/wsdlgen/src/test/java/datatypes/DataTypesTestCase.java | 2 +- .../ws/wsdlgen/src/test/java/datatypes/DynamicSDOTestCase.java | 2 +- .../ws/wsdlgen/src/test/java/helloworld/WSDLGenTestCase.java | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) (limited to 'sca-java-2.x/trunk/testing/itest') diff --git a/sca-java-2.x/trunk/testing/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/BuilderTestCase.java b/sca-java-2.x/trunk/testing/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/BuilderTestCase.java index b0c9f7728a..e499e06948 100644 --- a/sca-java-2.x/trunk/testing/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/BuilderTestCase.java +++ b/sca-java-2.x/trunk/testing/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/BuilderTestCase.java @@ -204,7 +204,7 @@ public class BuilderTestCase { Definition def = wsBinding.getGeneratedWSDLDocument(); TestUtils.writeWSDL(def); - javax.wsdl.Service svc = def.getService(new QName("http://builder.itest.sca.tuscany.apache.org/", "Service2")); + javax.wsdl.Service svc = def.getService(new QName("http://builder.itest.sca.tuscany.apache.org/", "ComponentB_Service2")); Port port = svc.getPort("Service2SOAP11Port"); Assert.assertEquals("/ComponentB/Service2",TestUtils.getPortAddress(port)); diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLTestCase.java b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLTestCase.java index 635c49b8ab..dbe172f792 100644 --- a/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLTestCase.java +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLTestCase.java @@ -93,7 +93,7 @@ public class QuestionMarkWSDLTestCase extends TestCase { Definition definition = wsdlReader.readWSDL("http://localhost:8085/foo/bar?wsdl"); assertNotNull(definition); Service service = definition.getService(new QName("http://axis2.ws.binding.sca.tuscany.apache.org/", - "HelloWorld")); + "HelloWorldService_HelloWorld")); Port port = service.getPort("ep1SOAP11Port"); String endpoint = getEndpoint(port); diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdlgen/src/test/java/datatypes/BaseFramework.java b/sca-java-2.x/trunk/testing/itest/ws/wsdlgen/src/test/java/datatypes/BaseFramework.java index 579d01c08b..4cae4595a4 100644 --- a/sca-java-2.x/trunk/testing/itest/ws/wsdlgen/src/test/java/datatypes/BaseFramework.java +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdlgen/src/test/java/datatypes/BaseFramework.java @@ -209,7 +209,7 @@ public class BaseFramework { return (Element)childNodes.item(0); } - private static void readWSDL(String serviceName) throws Exception { + private static void readWSDL(String componentName, String serviceName) throws Exception { WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader(); wsdlReader.setFeature("javax.wsdl.verbose",false); wsdlReader.setFeature("javax.wsdl.importDocuments",true); @@ -218,7 +218,7 @@ public class BaseFramework { assertNotNull(definition); // find portType - Service service = definition.getService(new QName("http://datatypes/", serviceName)); + Service service = definition.getService(new QName("http://datatypes/", componentName+'_'+serviceName)); Port port = service.getPort(serviceName + "SOAP11Port"); Binding binding = port.getBinding(); portType = binding.getPortType(); @@ -251,13 +251,13 @@ public class BaseFramework { } } - protected static void start(String serviceName) throws Exception { + protected static void start(String componentName, String serviceName) throws Exception { WSDLServiceGenerator.printWSDL = printWSDL; node = TuscanyRuntime.newInstance().createNode("default"); node.installContribution("datatypescontrib", "target/classes", null, null); node.startComposite("datatypescontrib", "DataTypes.composite"); printWSDL = false; // print WSDL once only - readWSDL(serviceName); + readWSDL(componentName, serviceName); } protected static void stop() throws Exception { diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdlgen/src/test/java/datatypes/DataTypesTestCase.java b/sca-java-2.x/trunk/testing/itest/ws/wsdlgen/src/test/java/datatypes/DataTypesTestCase.java index 48e8b635fe..1e83fe3435 100644 --- a/sca-java-2.x/trunk/testing/itest/ws/wsdlgen/src/test/java/datatypes/DataTypesTestCase.java +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdlgen/src/test/java/datatypes/DataTypesTestCase.java @@ -176,7 +176,7 @@ public class DataTypesTestCase extends BaseFramework { @BeforeClass public static void setUpBeforeClass() throws Exception { - BaseFramework.start("DataTypes"); + BaseFramework.start("DataTypes", "DataTypes"); } @AfterClass diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdlgen/src/test/java/datatypes/DynamicSDOTestCase.java b/sca-java-2.x/trunk/testing/itest/ws/wsdlgen/src/test/java/datatypes/DynamicSDOTestCase.java index 64fb9fb0e1..94d7765466 100644 --- a/sca-java-2.x/trunk/testing/itest/ws/wsdlgen/src/test/java/datatypes/DynamicSDOTestCase.java +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdlgen/src/test/java/datatypes/DynamicSDOTestCase.java @@ -71,7 +71,7 @@ public class DynamicSDOTestCase extends BaseFramework { @BeforeClass public static void setUpBeforeClass() throws Exception { - BaseFramework.start("GetDataServiceWithoutException"); + BaseFramework.start("DynamicSDO", "GetDataServiceWithoutException"); } @AfterClass diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdlgen/src/test/java/helloworld/WSDLGenTestCase.java b/sca-java-2.x/trunk/testing/itest/ws/wsdlgen/src/test/java/helloworld/WSDLGenTestCase.java index 7fabf4cc92..6954a8a7ac 100644 --- a/sca-java-2.x/trunk/testing/itest/ws/wsdlgen/src/test/java/helloworld/WSDLGenTestCase.java +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdlgen/src/test/java/helloworld/WSDLGenTestCase.java @@ -136,7 +136,7 @@ public class WSDLGenTestCase{ // talk to the service using JAXWS with WSDL generated from this service used Tuscany's ?wsdl // the idea here is to demonstrate that the service is providing a JAXWS compliant // WSDL - QName serviceName = new QName("http://helloworld/", "HelloWorldService"); + QName serviceName = new QName("http://helloworld/", "HelloWorldServiceComponent_HelloWorldService"); QName portName = new QName("http://helloworld/", "HelloWorldServiceSOAP11Port"); URL wsdlLocation = new URL("http://localhost:8085/HelloWorldServiceComponent?wsdl"); Service webService = Service.create( wsdlLocation, serviceName ); -- cgit v1.2.3