diff options
Diffstat (limited to 'tags/java-M1-20060518/java/testing/interop/clients/webserviceInteropDoc/src')
4 files changed, 0 insertions, 413 deletions
diff --git a/tags/java-M1-20060518/java/testing/interop/clients/webserviceInteropDoc/src/main/java/org/apache/tuscany/test/interop/client/LoopbackInteropDocServiceComponentImpl.java b/tags/java-M1-20060518/java/testing/interop/clients/webserviceInteropDoc/src/main/java/org/apache/tuscany/test/interop/client/LoopbackInteropDocServiceComponentImpl.java deleted file mode 100644 index b26344372f..0000000000 --- a/tags/java-M1-20060518/java/testing/interop/clients/webserviceInteropDoc/src/main/java/org/apache/tuscany/test/interop/client/LoopbackInteropDocServiceComponentImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.test.interop.client; - -import java.rmi.RemoteException; - -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; -import org.soapinterop.ComplexDocument; -import org.soapinterop.DocTestPortType; -import org.soapinterop.SimpleDocument1; -import org.soapinterop.SingleTag; - -/** - * This class implements the DocTest service component. - */ -@Service(DocTestPortType.class) -//FIXME workaround for JIRA TUSCANY-41 -@Scope("MODULE") -public class LoopbackInteropDocServiceComponentImpl implements DocTestPortType { - - public ComplexDocument ComplexDocument(ComplexDocument param0) throws RemoteException { - return param0; - } - - public SimpleDocument1 SimpleDocument(SimpleDocument1 param4) throws RemoteException { - return param4; - } - - public SingleTag SingleTag(SingleTag param2) throws RemoteException { - return param2; - } -} diff --git a/tags/java-M1-20060518/java/testing/interop/clients/webserviceInteropDoc/src/main/resources/sca.module b/tags/java-M1-20060518/java/testing/interop/clients/webserviceInteropDoc/src/main/resources/sca.module deleted file mode 100644 index f55c50f43f..0000000000 --- a/tags/java-M1-20060518/java/testing/interop/clients/webserviceInteropDoc/src/main/resources/sca.module +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
-
- Licensed 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.
- -->
-<module xmlns="http://www.osoa.org/xmlns/sca/0.9" xmlns:v="http://www.osoa.org/xmlns/sca/values/0.9"
- name="interop.client">
-
- <import.sdo factory="org.soapinterop.SoapinteropFactory"/>
- <import.wsdl wsdlLocation="wsdl/interopdoc.wsdl"/>
-
- <component name="LoopbackInteropDocServiceComponent">
- <implementation.java class="org.apache.tuscany.test.interop.client.LoopbackInteropDocServiceComponentImpl"/>
- </component>
-
- <externalService name="RemoteInteropDocService">
- <interface.wsdl interface="http://soapinterop.org/#wsdl.interface(DocTestPortType)"/>
- <binding.ws port="http://soapinterop.org/#wsdl.endpoint(interopDocSvc/interopDocPort)"/>
- </externalService> - - <externalService name="LocalHostInteropDocService">
- <interface.wsdl interface="http://soapinterop.org/#wsdl.interface(DocTestPortType)"/>
- <binding.ws uri="http://localhost:8080/interop-service-webserviceInteropDoc/services/InteropDocService"
- port="http://soapinterop.org/#wsdl.endpoint(interopDocSvc/interopDocPort)"/>
- </externalService>
-
-</module>
diff --git a/tags/java-M1-20060518/java/testing/interop/clients/webserviceInteropDoc/src/main/resources/wsdl/interopdoc.wsdl b/tags/java-M1-20060518/java/testing/interop/clients/webserviceInteropDoc/src/main/resources/wsdl/interopdoc.wsdl deleted file mode 100644 index 2477be396b..0000000000 --- a/tags/java-M1-20060518/java/testing/interop/clients/webserviceInteropDoc/src/main/resources/wsdl/interopdoc.wsdl +++ /dev/null @@ -1,179 +0,0 @@ -<?xml version="1.0"?>
-<!--
- Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
-
- Licensed 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="InteropTestDoc" targetNamespace="http://soapinterop.org/"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:tns="http://soapinterop.org/"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
-
- <types>
-
- <xsd:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/" xmlns:interop="http://soapinterop.org/">
-
- <xsd:element name="SingleTag">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="SingleTag" type="interop:SingleTag"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:complexType name="SingleTag"/>
- <xsd:element name="SingleTagResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="SingleTag" type="interop:SingleTag"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="SimpleDocument">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="SimpleDocument" type="interop:SimpleDocument"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:complexType name="SimpleDocument">
- <xsd:simpleContent>
- <xsd:extension base="xsd:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
- <xsd:element name="SimpleDocumentResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="SimpleDocument" type="interop:SimpleDocument"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="ComplexDocument">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="ComplexDocument" type="interop:ComplexDocument"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:complexType name="ComplexDocument">
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="simpleDoc" type="interop:ArrayOfSimpleDocument"/>
- <xsd:element minOccurs="0" maxOccurs="1" name="child" type="interop:ChildDocument"/>
- </xsd:sequence>
- <xsd:attribute name="AnAttribute" type="xsd:string"/>
- </xsd:complexType>
- <xsd:complexType name="ArrayOfSimpleDocument">
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="SimpleDocument" nillable="true" type="interop:SimpleDocument"/>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="ChildDocument">
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="childSimpleDoc" type="interop:ArrayOfSimpleDocument"/>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:element name="ComplexDocumentResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="ComplexDocument" type="interop:ComplexDocument"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- </xsd:schema>
-
- </types>
-
- <message name="SingleTagSoapIn">
- <part name="parameters" element="tns:SingleTag"/>
- </message>
- <message name="SingleTagSoapOut">
- <part name="outputDoc" element="tns:SingleTagResponse"/>
- </message>
- <message name="SimpleDocumentSoapIn">
- <part name="parameters" element="tns:SimpleDocument"/>
- </message>
- <message name="SimpleDocumentSoapOut">
- <part name="outputDoc" element="tns:SimpleDocumentResponse"/>
- </message>
- <message name="ComplexDocumentSoapIn">
- <part name="parameters" element="tns:ComplexDocument"/>
- </message>
- <message name="ComplexDocumentSoapOut">
- <part name="outputDoc" element="tns:ComplexDocumentResponse"/>
- </message>
-
- <portType name="DocTestPortType">
-
- <operation name="SingleTag">
- <input message="tns:SingleTagSoapIn"/>
- <output message="tns:SingleTagSoapOut"/>
- </operation>
- <operation name="SimpleDocument">
- <input message="tns:SimpleDocumentSoapIn"/>
- <output message="tns:SimpleDocumentSoapOut"/>
- </operation>
- <operation name="ComplexDocument">
- <input message="tns:ComplexDocumentSoapIn"/>
- <output message="tns:ComplexDocumentSoapOut"/>
- </operation>
-
- </portType>
-
- <binding name="doc_test_binding" type="tns:DocTestPortType">
- <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
-
- <operation name="SingleTag">
- <soap:operation soapAction="http://soapinterop.org/SingleTag"/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
-
- <operation name="SimpleDocument">
- <soap:operation soapAction="http://soapinterop.org/SimpleDocument"/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
-
- <operation name="ComplexDocument">
- <soap:operation soapAction="http://soapinterop.org/ComplexDocument"/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
- </binding>
-
- <service name="interopDocSvc">
-
- <port name="interopDocPort" binding="tns:doc_test_binding">
- <soap:address location="http://www.whitemesa.net/interopdoc"/>
- <http-conf:client xmlns:http-conf="http://celtix.objectweb.org/transports/http/configuration"
- AllowChunking="false"/>
- </port>
-
- </service>
-
-</definitions>
diff --git a/tags/java-M1-20060518/java/testing/interop/clients/webserviceInteropDoc/src/test/java/org/apache/tuscany/test/interop/client/InteropDocClientTestCase.java b/tags/java-M1-20060518/java/testing/interop/clients/webserviceInteropDoc/src/test/java/org/apache/tuscany/test/interop/client/InteropDocClientTestCase.java deleted file mode 100644 index a23979f39d..0000000000 --- a/tags/java-M1-20060518/java/testing/interop/clients/webserviceInteropDoc/src/test/java/org/apache/tuscany/test/interop/client/InteropDocClientTestCase.java +++ /dev/null @@ -1,149 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.test.interop.client; - -import java.rmi.RemoteException; - -import junit.framework.TestCase; - -import org.apache.tuscany.core.client.TuscanyRuntime; -import org.osoa.sca.CurrentModuleContext; -import org.soapinterop.ArrayOfSimpleDocument; -import org.soapinterop.ChildDocument; -import org.soapinterop.ComplexDocument; -import org.soapinterop.DocTestPortType; -import org.soapinterop.SimpleDocument; -import org.soapinterop.SimpleDocument1; -import org.soapinterop.SingleTag; - -import commonj.sdo.helper.DataFactory; - -public class InteropDocClientTestCase extends TestCase { - - private TuscanyRuntime tuscany; - private DataFactory dataFactory; - private DocTestPortType interopDoc; - private ClassLoader oldCL; - - public void testSingleTag() throws RemoteException { - - // Create the input - SingleTag input=(SingleTag)dataFactory.create(SingleTag.class); - - // Invoke the service - SingleTag output=interopDoc.SingleTag(input); - - // Test the results - assertNotNull(output); - - } - - public void testSimpleDocument() throws RemoteException { - - // Create the input - SimpleDocument1 input=(SimpleDocument1)dataFactory.create(SimpleDocument1.class); - input.setValue("123"); - - // Invoke the service - SimpleDocument1 output=interopDoc.SimpleDocument(input); - - // Test the results - assertNotNull(output); - assertEquals("123", output.getValue()); - - } - - public void testComplexDocument() throws RemoteException { - - // Create the input - ComplexDocument input = (ComplexDocument)dataFactory.create(ComplexDocument.class); - input.setAnAttribute("789"); - ChildDocument childDocument = (ChildDocument)dataFactory.create(ChildDocument.class); - SimpleDocument simpleDocument = (SimpleDocument)dataFactory.create(SimpleDocument.class);; - SimpleDocument1 simpleDocument1 = (SimpleDocument1)dataFactory.create(SimpleDocument1.class);; - simpleDocument.setSimpleDocument(simpleDocument1); - simpleDocument1.setValue("456"); - ArrayOfSimpleDocument arrayOfSimpleDocument = (ArrayOfSimpleDocument)dataFactory.create(ArrayOfSimpleDocument.class);; - arrayOfSimpleDocument.getSimpleDocument().add(simpleDocument1); - childDocument.setChildSimpleDoc(arrayOfSimpleDocument); - input.setChild(childDocument); - - // Invoke the service - ComplexDocument output=interopDoc.ComplexDocument(input); - - // Test the results - assertNotNull(output); - assertEquals("789", output.getAnAttribute()); - assertNotNull(output.getChild()); - assertNotNull(output.getChild().getChildSimpleDoc()); - - //FIXME Add more tests of the output document - - } - - protected void setUp() throws Exception { - super.setUp(); - - // Required to allow the SDO runtime to use the correct classloader - oldCL=Thread.currentThread().getContextClassLoader(); - Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); - - // Obtain Tuscany runtime - tuscany = new TuscanyRuntime("interopclient", null); - - // Start the runtime - tuscany.start(); - - // Get the SDO DataFactory - dataFactory=DataFactory.INSTANCE; - - // Locate the service to test - interopDoc=locateInteropDocService(); - - } - - /** - * Locate the interop service to test - * @return - */ - protected DocTestPortType locateInteropDocService() { - String interopLocation = System.getProperty("interopLocation"); - - // Valid service names are: - // RemoteInteropDocService: the live interop Web Service - // LocalHostInteropDocService: the interop Web Service hosted by Tuscany on localhost - // LoopbackInteropDocServiceComponent: a dummy loopback service component - - // To specify the service name run mvn -DinteropDocServiceName="RemoteInteropDocService" - - if (interopLocation == null) - interopLocation = "Remote"; - - return (DocTestPortType)CurrentModuleContext.getContext().locateService(interopLocation + "InteropDocService"); - } - - protected void tearDown() throws Exception { - - // Stop the runtime - tuscany.stop(); - - Thread.currentThread().setContextClassLoader(oldCL); - - super.tearDown(); - } - -} |