From 3dd7e2c4da9c80b8182a2d04dc129a67aa7910df Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 11 Nov 2009 23:06:58 +0000 Subject: Moving 1.x branches git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835121 13f79535-47bb-0310-9956-ffa450edef68 --- .../modules/interface-wsdl-xml/.checkstyle | 24 -- .../sca-java-0.99/modules/interface-wsdl-xml/.pmd | 20 -- .../modules/interface-wsdl-xml/.ruleset | 190 ------------- .../modules/interface-wsdl-xml/DISCLAIMER | 8 - .../modules/interface-wsdl-xml/LICENSE | 205 -------------- .../modules/interface-wsdl-xml/NOTICE | 6 - .../modules/interface-wsdl-xml/pom.xml | 70 ----- .../sca/interfacedef/wsdl/xml/WSDLConstants.java | 35 --- .../wsdl/xml/WSDLDocumentProcessor.java | 183 ------------ .../wsdl/xml/WSDLInterfaceProcessor.java | 193 ------------- .../interfacedef/wsdl/xml/WSDLModelResolver.java | 312 --------------------- .../interfacedef/wsdl/xml/XMLDocumentHelper.java | 181 ------------ .../wsdl/xml/XSDDocumentProcessor.java | 77 ----- .../interfacedef/wsdl/xml/XSDModelResolver.java | 206 -------------- ...ca.contribution.processor.StAXArtifactProcessor | 19 -- ...sca.contribution.processor.URLArtifactProcessor | 20 -- ...tuscany.sca.contribution.resolver.ModelResolver | 19 -- .../wsdl/introspect/TestModelResolver.java | 63 ----- .../WSDLInterfaceIntrospectorTestCase.java | 97 ------- .../WSDLOperationIntrospectorTestCase.java | 142 ---------- .../introspect/WrapperStyleOperationTestCase.java | 96 ------- .../sca/interfacedef/wsdl/xml/ReadTestCase.java | 127 --------- .../wsdl/xml/WSDLDocumentProcessorTestCase.java | 92 ------ .../sca/interfacedef/wsdl/xml/WSDLTestCase.java | 116 -------- .../sca/interfacedef/wsdl/xml/WriteTestCase.java | 117 -------- .../wsdl/xml/XMLDocumentHelperTestCase.java | 53 ---- .../wsdl/xml/XSDDocumentProcessorTestCase.java | 97 ------- .../sca/interfacedef/wsdl/xml/Calculator.composite | 55 ---- .../wsdl/xml/CalculatorComponent.constrainingType | 36 --- .../wsdl/xml/CalculatorImpl.componentType | 33 --- .../tuscany/sca/interfacedef/wsdl/xml/example.wsdl | 26 -- .../interfacedef/wsdl/xml/invalid-stockquote.wsdl | 58 ---- .../tuscany/sca/interfacedef/wsdl/xml/ipo.xsd | 136 --------- .../sca/interfacedef/wsdl/xml/stockquote.wsdl | 58 ---- .../tuscany/sca/interfacedef/wsdl/xml/test1.wsdl | 45 --- .../tuscany/sca/interfacedef/wsdl/xml/test1.xsd | 33 --- .../tuscany/sca/interfacedef/wsdl/xml/test2.wsdl | 63 ----- .../wsdl/xml/unwrapped-stockquote.wsdl | 76 ----- .../test/resources/wsdl/helloworld-interface.wsdl | 64 ----- .../test/resources/wsdl/helloworld-service.wsdl | 49 ---- .../src/test/resources/xsd/greeting.xsd | 29 -- .../src/test/resources/xsd/name.xsd | 29 -- 42 files changed, 3558 deletions(-) delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/.checkstyle delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/.pmd delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/.ruleset delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/DISCLAIMER delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/LICENSE delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/NOTICE delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/pom.xml delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLConstants.java delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelper.java delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XSDDocumentProcessor.java delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XSDModelResolver.java delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/TestModelResolver.java delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.java delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.java delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelperTestCase.java delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XSDDocumentProcessorTestCase.java delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/Calculator.composite delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorComponent.constrainingType delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorImpl.componentType delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/example.wsdl delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/invalid-stockquote.wsdl delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/ipo.xsd delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/stockquote.wsdl delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.wsdl delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.xsd delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test2.wsdl delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/unwrapped-stockquote.wsdl delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-interface.wsdl delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-service.wsdl delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/xsd/greeting.xsd delete mode 100644 branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/xsd/name.xsd (limited to 'branches/sca-java-0.99/modules/interface-wsdl-xml') diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/.checkstyle b/branches/sca-java-0.99/modules/interface-wsdl-xml/.checkstyle deleted file mode 100644 index e3c216986d..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/.checkstyle +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/.pmd b/branches/sca-java-0.99/modules/interface-wsdl-xml/.pmd deleted file mode 100644 index 2db10d6a6a..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/.pmd +++ /dev/null @@ -1,20 +0,0 @@ - - -truefalse \ No newline at end of file diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/.ruleset b/branches/sca-java-0.99/modules/interface-wsdl-xml/.ruleset deleted file mode 100644 index ba9b5ce886..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/.ruleset +++ /dev/null @@ -1,190 +0,0 @@ - - - - PMD Plugin preferences rule set - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/DISCLAIMER b/branches/sca-java-0.99/modules/interface-wsdl-xml/DISCLAIMER deleted file mode 100644 index d68a410903..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/DISCLAIMER +++ /dev/null @@ -1,8 +0,0 @@ -Apache Tuscany is an effort undergoing incubation at The Apache Software -Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is -required of all newly accepted projects until a further review indicates that -the infrastructure, communications, and decision making process have stabilized -in a manner consistent with other successful ASF projects. While incubation -status is not necessarily a reflection of the completeness or stability of the -code, it does indicate that the project has yet to be fully endorsed by the ASF. - diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/LICENSE b/branches/sca-java-0.99/modules/interface-wsdl-xml/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. - - - diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/NOTICE b/branches/sca-java-0.99/modules/interface-wsdl-xml/NOTICE deleted file mode 100644 index 94481d6cfa..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2007 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/pom.xml b/branches/sca-java-0.99/modules/interface-wsdl-xml/pom.xml deleted file mode 100644 index e342b207a8..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/pom.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-modules - 0.99-incubating-SNAPSHOT - ../pom.xml - - tuscany-interface-wsdl-xml - Apache Tuscany SCA XML WSDL Interface Extension - - - - org.apache.tuscany.sca - tuscany-contribution - 0.99-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-contribution-namespace - 0.99-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-contribution-impl - 0.99-incubating-SNAPSHOT - test - - - - org.apache.tuscany.sca - tuscany-assembly-xml - 0.99-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-interface-wsdl - 0.99-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-binding-sca - 0.99-incubating-SNAPSHOT - test - - - diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLConstants.java b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLConstants.java deleted file mode 100644 index 7de5d5349f..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLConstants.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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. - */ -package org.apache.tuscany.sca.interfacedef.wsdl.xml; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.xml.Constants; - -public interface WSDLConstants { - - String INTERFACE_WSDL = "interface.wsdl"; - QName INTERFACE_WSDL_QNAME = new QName(Constants.SCA10_NS, "interface.wsdl"); - String INTERFACE = "interface"; - String CALLBACK_INTERFACE = "callbackInterface"; - String WSDL_LOCATION = "wsdlLocation"; - String WSDLI_NS = "http://www.w3.org/2004/08/wsdl-instance"; - QName WSDL_LOCATION_QNAME = new QName(WSDLI_NS, WSDL_LOCATION); - -} diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java deleted file mode 100644 index 635f88feb8..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * 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. - */ - -package org.apache.tuscany.sca.interfacedef.wsdl.xml; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.net.URL; -import java.util.List; - -import javax.wsdl.Definition; -import javax.wsdl.Import; -import javax.xml.namespace.QName; -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamConstants; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.service.ContributionReadException; -import org.apache.tuscany.sca.contribution.service.ContributionResolveException; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.XSDefinition; - -/** - * An ArtifactProcessor for WSDL documents. - * - * @version $Rev$ $Date$ - */ -public class WSDLDocumentProcessor implements URLArtifactProcessor { - - public static final QName WSDL11 = new QName("http://schemas.xmlsoap.org/wsdl/", "definitions"); - public static final QName XSD = new QName("http://www.w3.org/2001/XMLSchema", "schema"); - - private final static XMLInputFactory inputFactory = XMLInputFactory.newInstance(); - - private WSDLFactory factory; - - public WSDLDocumentProcessor(ModelFactoryExtensionPoint modelFactories) { - this.factory = modelFactories.getFactory(WSDLFactory.class); - } - - public WSDLDefinition read(URL contributionURL, URI artifactURI, URL artifactURL) throws ContributionReadException { - try { - return indexRead(artifactURL); - } catch (Exception e) { - throw new ContributionReadException(e); - } - } - - public void resolve(WSDLDefinition model, ModelResolver resolver) throws ContributionResolveException { - Definition definition = model.getDefinition(); - if (definition != null) { - for (Object imports : definition.getImports().values()) { - List importList = (List)imports; - for (Object i : importList) { - Import imp = (Import)i; - if (imp.getDefinition() != null) { - continue; - } - if (imp.getLocationURI() == null) { - // FIXME: [rfeng] By the WSDL 1.1 spec, the location attribute is required - // We need to resolve it by QName - WSDLDefinition proxy = factory.createWSDLDefinition(); - proxy.setUnresolved(true); - proxy.setNamespace(imp.getNamespaceURI()); - WSDLDefinition resolved = resolver.resolveModel(WSDLDefinition.class, proxy); - if (resolved != null && !resolved.isUnresolved()) { - imp.setDefinition(resolved.getDefinition()); - } - } else { - String location = imp.getLocationURI(); - URI uri = URI.create(location); - if (uri.isAbsolute()) { - WSDLDefinition resolved; - try { - resolved = read(null, uri, uri.toURL()); - imp.setDefinition(resolved.getDefinition()); - } catch (Exception e) { - throw new ContributionResolveException(e); - } - } else { - if (location.startsWith("/")) { - // This is a relative URI against a contribution - location = location.substring(1); - // TODO: Need to resolve it against the contribution - } else { - // This is a relative URI against the WSDL document - URI baseURI = URI.create(model.getDefinition().getDocumentBaseURI()); - URI locationURI = baseURI.resolve(location); - WSDLDefinition resolved; - try { - resolved = read(null, locationURI, locationURI.toURL()); - imp.setDefinition(resolved.getDefinition()); - } catch (Exception e) { - throw new ContributionResolveException(e); - } - } - } - } - } - } - } - } - - public String getArtifactType() { - return ".wsdl"; - } - - public Class getModelType() { - return WSDLDefinition.class; - } - - /** - * Read the namespace for the WSDL definition and inline schemas - * - * @param doc - * @return - * @throws IOException - * @throws XMLStreamException - */ - protected WSDLDefinition indexRead(URL doc) throws Exception { - WSDLDefinition wsdlDefinition = factory.createWSDLDefinition(); - wsdlDefinition.setUnresolved(true); - wsdlDefinition.setLocation(doc.toURI()); - - InputStream is = doc.openStream(); - try { - XMLStreamReader reader = inputFactory.createXMLStreamReader(is); - int eventType = reader.getEventType(); - while (true) { - if (eventType == XMLStreamConstants.START_ELEMENT) { - if (WSDL11.equals(reader.getName())) { - String tns = reader.getAttributeValue(null, "targetNamespace"); - wsdlDefinition.setNamespace(tns); - // The definition is marked as resolved but not loaded - wsdlDefinition.setUnresolved(false); - wsdlDefinition.setDefinition(null); - } - if (XSD.equals(reader.getName())) { - String tns = reader.getAttributeValue(null, "targetNamespace"); - XSDefinition xsd = factory.createXSDefinition(); - xsd.setUnresolved(true); - xsd.setNamespace(tns); - // The definition is marked as resolved but not loaded - xsd.setUnresolved(false); - xsd.setSchema(null); - wsdlDefinition.getXmlSchemas().add(xsd); - } - } - if (reader.hasNext()) { - eventType = reader.next(); - } else { - break; - } - } - return wsdlDefinition; - } finally { - is.close(); - } - } - -} diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java deleted file mode 100644 index e3f562ec82..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java +++ /dev/null @@ -1,193 +0,0 @@ -/* - * 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. - */ - -package org.apache.tuscany.sca.interfacedef.wsdl.xml; - -import static javax.xml.stream.XMLStreamConstants.END_ELEMENT; - -import javax.wsdl.PortType; -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.XMLStreamWriter; - -import org.apache.tuscany.sca.assembly.xml.Constants; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.service.ContributionReadException; -import org.apache.tuscany.sca.contribution.service.ContributionResolveException; -import org.apache.tuscany.sca.contribution.service.ContributionWriteException; -import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract; - -public class WSDLInterfaceProcessor implements StAXArtifactProcessor, WSDLConstants { - - private WSDLFactory wsdlFactory; - - public WSDLInterfaceProcessor(ModelFactoryExtensionPoint modelFactories) { - this.wsdlFactory = modelFactories.getFactory(WSDLFactory.class); - } - - /** - * Create a WSDL interface from a URI. - * @param uri - * @return - * @throws ContributionReadException - */ - private WSDLInterface createWSDLInterface(String uri) throws ContributionReadException { - WSDLInterface wsdlInterface = wsdlFactory.createWSDLInterface(); - wsdlInterface.setUnresolved(true); - - // Read a qname in the form: - // namespace#wsdl.interface(name) - int index = uri.indexOf('#'); - if (index == -1) { - throw new ContributionReadException("Invalid WSDL interface attribute: " + uri); - } - String namespace = uri.substring(0, index); - String name = uri.substring(index + 1); - name = name.substring("wsdl.interface(".length(), name.length() - 1); - wsdlInterface.setName(new QName(namespace, name)); - - return wsdlInterface; - } - - public WSDLInterfaceContract read(XMLStreamReader reader) throws ContributionReadException { - try { - - // Read an - WSDLInterfaceContract wsdlInterfaceContract = wsdlFactory.createWSDLInterfaceContract(); - - // Read wsdlLocation - String location = reader.getAttributeValue(WSDLI_NS, WSDL_LOCATION); - wsdlInterfaceContract.setLocation(location); - - String uri = reader.getAttributeValue(null, INTERFACE); - if (uri != null) { - WSDLInterface wsdlInterface = createWSDLInterface(uri); - wsdlInterfaceContract.setInterface(wsdlInterface); - } - - uri = reader.getAttributeValue(null, CALLBACK_INTERFACE); - if (uri != null) { - WSDLInterface wsdlCallbackInterface = createWSDLInterface(uri); - wsdlInterfaceContract.setCallbackInterface(wsdlCallbackInterface); - } - - // Skip to end element - while (reader.hasNext()) { - if (reader.next() == END_ELEMENT && INTERFACE_WSDL_QNAME.equals(reader.getName())) { - break; - } - } - return wsdlInterfaceContract; - - } catch (XMLStreamException e) { - throw new ContributionReadException(e); - } - } - - public void write(WSDLInterfaceContract wsdlInterfaceContract, XMLStreamWriter writer) throws ContributionWriteException { - try { - // Write an - writer.writeStartElement(Constants.SCA10_NS, INTERFACE_WSDL); - - // Write interface name - WSDLInterface wsdlInterface = (WSDLInterface)wsdlInterfaceContract.getInterface(); - if (wsdlInterface != null) { - QName qname = wsdlInterface.getName(); - String uri = qname.getNamespaceURI() + "#wsdl.interface(" + qname.getLocalPart() + ")"; - writer.writeAttribute(INTERFACE, uri); - } - - WSDLInterface wsdlCallbackInterface = (WSDLInterface)wsdlInterfaceContract.getCallbackInterface(); - if (wsdlCallbackInterface != null) { - QName qname = wsdlCallbackInterface.getName(); - String uri = qname.getNamespaceURI() + "#wsdl.interface(" + qname.getLocalPart() + ")"; - writer.writeAttribute(CALLBACK_INTERFACE, uri); - } - - // Write location - if (wsdlInterfaceContract.getLocation() != null) { - writer.writeAttribute(WSDLI_NS, WSDL_LOCATION, wsdlInterfaceContract.getLocation()); - } - - writer.writeEndElement(); - - } catch (XMLStreamException e) { - throw new ContributionWriteException(e); - } - } - - private WSDLInterface resolveWSDLInterface(WSDLInterface wsdlInterface, ModelResolver resolver) throws ContributionResolveException { - - if (wsdlInterface != null && wsdlInterface.isUnresolved()) { - - // Resolve the WSDL interface - wsdlInterface = resolver.resolveModel(WSDLInterface.class, wsdlInterface); - if (wsdlInterface.isUnresolved()) { - - // If the WSDL interface has never been resolved yet, do it now - // First, resolve the WSDL definition for the given namespace - WSDLDefinition wsdlDefinition = wsdlFactory.createWSDLDefinition(); - wsdlDefinition.setUnresolved(true); - wsdlDefinition.setNamespace(wsdlInterface.getName().getNamespaceURI()); - wsdlDefinition = resolver.resolveModel(WSDLDefinition.class, wsdlDefinition); - if (!wsdlDefinition.isUnresolved()) { - PortType portType = wsdlDefinition.getDefinition().getPortType(wsdlInterface.getName()); - if (portType != null) { - - // Introspect the WSDL portType and add the resulting - // WSDLInterface to the resolver - try { - wsdlInterface = wsdlFactory.createWSDLInterface(portType, wsdlDefinition.getInlinedSchemas(), resolver); - } catch (InvalidInterfaceException e) { - throw new ContributionResolveException(e); - } - resolver.addModel(wsdlInterface); - wsdlInterface.setWsdlDefinition(wsdlDefinition); - } - } - } - } - return wsdlInterface; - } - - public void resolve(WSDLInterfaceContract wsdlInterfaceContract, ModelResolver resolver) throws ContributionResolveException { - - // Resolve the interface and callback interface - WSDLInterface wsdlInterface = resolveWSDLInterface((WSDLInterface)wsdlInterfaceContract.getInterface(), resolver); - wsdlInterfaceContract.setInterface(wsdlInterface); - - WSDLInterface wsdlCallbackInterface = resolveWSDLInterface((WSDLInterface)wsdlInterfaceContract.getCallbackInterface(), resolver); - wsdlInterfaceContract.setCallbackInterface(wsdlCallbackInterface); - } - - public QName getArtifactType() { - return WSDLConstants.INTERFACE_WSDL_QNAME; - } - - public Class getModelType() { - return WSDLInterfaceContract.class; - } -} diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java deleted file mode 100644 index 6c57fdf949..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java +++ /dev/null @@ -1,312 +0,0 @@ -/* - * 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. - */ - -package org.apache.tuscany.sca.interfacedef.wsdl.xml; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.wsdl.Definition; -import javax.wsdl.Types; -import javax.wsdl.WSDLException; -import javax.wsdl.extensions.ExtensionRegistry; -import javax.wsdl.extensions.schema.Schema; -import javax.wsdl.xml.WSDLLocator; -import javax.wsdl.xml.WSDLReader; -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.contribution.Contribution; -import org.apache.tuscany.sca.contribution.DeployedArtifact; -import org.apache.tuscany.sca.contribution.Import; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.namespace.NamespaceImport; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.service.ContributionReadException; -import org.apache.tuscany.sca.contribution.service.ContributionRuntimeException; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.apache.ws.commons.schema.XmlSchemaCollection; -import org.w3c.dom.Element; -import org.xml.sax.InputSource; - -/** - * A Model Resolver for WSDL models. - * - * @version $Rev: 557916 $ $Date: 2007-07-20 01:04:40 -0700 (Fri, 20 Jul 2007) $ - */ -public class WSDLModelResolver implements ModelResolver { - private Contribution contribution; - private Map> map = new HashMap>(); - private javax.wsdl.factory.WSDLFactory wsdl4jFactory; - private ExtensionRegistry wsdlExtensionRegistry; - private WSDLFactory wsdlFactory; - - public WSDLModelResolver(Contribution contribution, ModelFactoryExtensionPoint modelFactories) { - this.contribution = contribution; - this.wsdlFactory = modelFactories.getFactory(WSDLFactory.class); - this.wsdl4jFactory = modelFactories.getFactory(javax.wsdl.factory.WSDLFactory.class); - wsdlExtensionRegistry = this.wsdl4jFactory.newPopulatedExtensionRegistry(); - } - - /** - * Implementation of a WSDL locator. - */ - private class WSDLLocatorImpl implements WSDLLocator { - private InputStream inputStream; - private URL base; - private String latestImportURI; - - public WSDLLocatorImpl(URL base, InputStream is) { - this.base = base; - this.inputStream = is; - } - - public void close() { - try { - inputStream.close(); - } catch (IOException e) { - // Ignore - } - } - - public InputSource getBaseInputSource() { - try { - return XMLDocumentHelper.getInputSource(base, inputStream); - } catch (IOException e) { - throw new IllegalArgumentException(e); - } - } - - public String getBaseURI() { - return base.toString(); - } - - public InputSource getImportInputSource(String parentLocation, String importLocation) { - try { - if (importLocation == null) { - throw new IllegalArgumentException("Required attribute 'location' is missing."); - } - - URL url = null; - if (importLocation.startsWith("/")) { - // The URI is relative to the contribution - String uri = importLocation.substring(1); - for (DeployedArtifact a : contribution.getArtifacts()) { - if (a.getURI().equals(uri)) { - url = new URL(a.getLocation()); - break; - } - } - } else { - url = new URL(new URL(parentLocation), importLocation); - } - if (url == null) { - return null; - } - latestImportURI = url.toString(); - return XMLDocumentHelper.getInputSource(url); - } catch (Exception e) { - throw new ContributionRuntimeException(e); - } - } - - public String getLatestImportURI() { - return latestImportURI; - } - - } - - public void addModel(Object resolved) { - WSDLDefinition definition = (WSDLDefinition)resolved; - List list = map.get(definition.getNamespace()); - if (list == null) { - list = new ArrayList(); - map.put(definition.getNamespace(), list); - } - list.add(definition); - } - - public Object removeModel(Object resolved) { - WSDLDefinition definition = (WSDLDefinition)resolved; - List list = map.get(definition.getNamespace()); - if (list == null) { - return null; - } else { - return list.remove(definition); - } - } - - /** - * Create a facade Definition which imports all the defintions - * - * @param definitions A list of the WSDL definitions under the same target namespace - * @return The aggregated WSDL definition - */ - private WSDLDefinition aggregate(List definitions) { - if (definitions == null || definitions.size() == 0) { - return null; - } - if (definitions.size() == 1) { - WSDLDefinition d = definitions.get(0); - loadOnDemand(d, d.getInlinedSchemas()); - return d; - } - WSDLDefinition aggregated = wsdlFactory.createWSDLDefinition(); - for (WSDLDefinition d : definitions) { - loadOnDemand(d, aggregated.getInlinedSchemas()); - } - Definition facade = wsdl4jFactory.newDefinition(); - String ns = definitions.get(0).getNamespace(); - facade.setQName(new QName(ns, "$aggregated$")); - facade.setTargetNamespace(ns); - - for (WSDLDefinition d : definitions) { - if (d.getDefinition() != null) { - javax.wsdl.Import imp = facade.createImport(); - imp.setNamespaceURI(d.getNamespace()); - imp.setDefinition(d.getDefinition()); - imp.setLocationURI(d.getDefinition().getDocumentBaseURI()); - facade.addImport(imp); - } - } - aggregated.setDefinition(facade); - definitions.clear(); - definitions.add(aggregated); - return aggregated; - } - - public T resolveModel(Class modelClass, T unresolved) { - - // Lookup a definition for the given namespace - String namespace = ((WSDLDefinition)unresolved).getNamespace(); - List list = map.get(namespace); - WSDLDefinition resolved = aggregate(list); - if (resolved != null && !resolved.isUnresolved()) { - return modelClass.cast(resolved); - } - - // No definition found, delegate the resolution to the imports - for (Import import_ : this.contribution.getImports()) { - if (import_ instanceof NamespaceImport) { - NamespaceImport namespaceImport = (NamespaceImport)import_; - if (namespaceImport.getNamespace().equals(namespace)) { - - // Delegate the resolution to the import resolver - resolved = - namespaceImport.getModelResolver().resolveModel(WSDLDefinition.class, - (WSDLDefinition)unresolved); - if (!resolved.isUnresolved()) { - return modelClass.cast(resolved); - } - } - } - } - return modelClass.cast(unresolved); - } - - /** - * Load the WSDL definition on demand - * @param def - * @param schemaCollection - */ - private void loadOnDemand(WSDLDefinition def, XmlSchemaCollection schemaCollection) { - if (def.getDefinition() == null && def.getLocation() != null) { - // Load the definition on-demand - try { - loadDefinition(def, schemaCollection); - } catch (ContributionReadException e) { - throw new RuntimeException(e); - } - } - } - - // private Map loadedDefinitions = new Hashtable(); - - /** - * Load the WSDL definition and inline schemas - * - * @param wsdlDef - * @param schemaCollection - * @throws ContributionReadException - */ - private void loadDefinition(WSDLDefinition wsdlDef, XmlSchemaCollection schemaCollection) - throws ContributionReadException { - if (wsdlDef.getDefinition() != null || wsdlDef.getLocation() == null) { - return; - } - try { - URL artifactURL = wsdlDef.getLocation().toURL(); - // Read a WSDL document - InputStream is = artifactURL.openStream(); - WSDLReader reader = wsdl4jFactory.newWSDLReader(); - reader.setFeature("javax.wsdl.verbose", false); - reader.setFeature("javax.wsdl.importDocuments", true); - // FIXME: We need to decide if we should disable the import processing by WSDL4J - // reader.setFeature("javax.wsdl.importDocuments", false); - reader.setExtensionRegistry(wsdlExtensionRegistry); - - WSDLLocatorImpl locator = new WSDLLocatorImpl(artifactURL, is); - Definition definition = reader.readWSDL(locator); - wsdlDef.setDefinition(definition); - - //Read inline schemas - readInlineSchemas(definition, schemaCollection); - } catch (WSDLException e) { - throw new ContributionReadException(e); - } catch (IOException e) { - throw new ContributionReadException(e); - } - } - - /** - * Populate the inline schemas including those from the imported definitions - * - * @param definition - * @param schemaCollection - */ - private void readInlineSchemas(Definition definition, XmlSchemaCollection schemaCollection) { - Types types = definition.getTypes(); - if (types != null) { - schemaCollection.setSchemaResolver(new XSDModelResolver.URIResolverImpl(contribution)); - for (Object ext : types.getExtensibilityElements()) { - if (ext instanceof Schema) { - Element element = ((Schema)ext).getElement(); - schemaCollection.setBaseUri(((Schema)ext).getDocumentBaseURI()); - schemaCollection.read(element, element.getBaseURI()); - } - } - } - for (Object imports : definition.getImports().values()) { - List impList = (List)imports; - for (Object i : impList) { - javax.wsdl.Import anImport = (javax.wsdl.Import)i; - // Read inline schemas - if (anImport.getDefinition() != null) { - readInlineSchemas(anImport.getDefinition(), schemaCollection); - } - } - } - } - -} diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelper.java b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelper.java deleted file mode 100644 index e5cd9d9a15..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelper.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * 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. - */ - -package org.apache.tuscany.sca.interfacedef.wsdl.xml; - -import java.io.BufferedInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; -import java.net.URL; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamConstants; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import org.xml.sax.InputSource; - -/** - * @version $Rev$ $Date$ - */ -public class XMLDocumentHelper { - public static final QName WSDL11 = new QName("http://schemas.xmlsoap.org/wsdl/", "definitions"); - public static final QName XSD = new QName("http://www.w3.org/2001/XMLSchema", "schema"); - public static final QName WSDL20 = new QName("http://www.w3.org/ns/wsdl", "description"); - - protected static final int BUFFER_SIZE = 256; - - /** - * Detect the XML encoding of the WSDL document - * - * @param is The input stream - * @return The encoding - * @throws IOException - */ - public static String getEncoding(InputStream is) throws IOException { - if (!is.markSupported()) - is = new BufferedInputStream(is); - - byte[] buffer = readBuffer(is); - return getXMLEncoding(buffer); - } - - /** - * Searches the array of bytes to determine the XML encoding. - */ - protected static String getXMLEncoding(byte[] bytes) { - String javaEncoding = null; - - if (bytes.length >= 4) { - if (((bytes[0] == -2) && (bytes[1] == -1)) || ((bytes[0] == 0) && (bytes[1] == 60))) - javaEncoding = "UnicodeBig"; - else if (((bytes[0] == -1) && (bytes[1] == -2)) || ((bytes[0] == 60) && (bytes[1] == 0))) - javaEncoding = "UnicodeLittle"; - else if ((bytes[0] == -17) && (bytes[1] == -69) && (bytes[2] == -65)) - javaEncoding = "UTF8"; - } - - String header = null; - - try { - if (javaEncoding != null) - header = new String(bytes, 0, bytes.length, javaEncoding); - else - header = new String(bytes, 0, bytes.length); - } catch (UnsupportedEncodingException e) { - return null; - } - - if (!header.startsWith(""); - int encodingIndex = header.indexOf("encoding", 6); - - if ((encodingIndex == -1) || (encodingIndex > endOfXMLPI)) - return "UTF-8"; - - int firstQuoteIndex = header.indexOf("\"", encodingIndex); - int lastQuoteIndex; - - if ((firstQuoteIndex == -1) || (firstQuoteIndex > endOfXMLPI)) { - firstQuoteIndex = header.indexOf("'", encodingIndex); - lastQuoteIndex = header.indexOf("'", firstQuoteIndex + 1); - } else - lastQuoteIndex = header.indexOf("\"", firstQuoteIndex + 1); - - return header.substring(firstQuoteIndex + 1, lastQuoteIndex); - } - - protected static byte[] readBuffer(InputStream is) throws IOException { - if (is.available() == 0) { - return new byte[0]; - } - - byte[] buffer = new byte[BUFFER_SIZE]; - is.mark(BUFFER_SIZE); - int bytesRead = is.read(buffer, 0, BUFFER_SIZE); - int totalBytesRead = bytesRead; - - while (bytesRead != -1 && (totalBytesRead < BUFFER_SIZE)) { - bytesRead = is.read(buffer, totalBytesRead, BUFFER_SIZE - totalBytesRead); - - if (bytesRead != -1) - totalBytesRead += bytesRead; - } - - if (totalBytesRead < BUFFER_SIZE) { - byte[] smallerBuffer = new byte[totalBytesRead]; - System.arraycopy(buffer, 0, smallerBuffer, 0, totalBytesRead); - smallerBuffer = buffer; - } - - is.reset(); - return buffer; - } - - public static InputSource getInputSource(URL url) throws IOException { - InputStream is = url.openStream(); - return getInputSource(url, is); - } - - public static InputSource getInputSource(URL url, InputStream is) throws IOException { - is = new BufferedInputStream(is); - String encoding = getEncoding(is); - InputSource inputSource = new InputSource(is); - inputSource.setEncoding(encoding); - // [rfeng] Make sure we set the system id as it will be used as the base URI for nested import/include - inputSource.setSystemId(url.toString()); - return inputSource; - } - - private final static XMLInputFactory inputFactory = XMLInputFactory.newInstance(); - - public static String readTargetNamespace(URL doc, QName element, boolean rootOnly, String attribute) - throws IOException, XMLStreamException { - if (attribute == null) { - attribute = "targetNamespace"; - } - InputStream is = doc.openStream(); - try { - XMLStreamReader reader = inputFactory.createXMLStreamReader(is); - int eventType = reader.getEventType(); - while (true) { - if (eventType == XMLStreamConstants.START_ELEMENT) { - if (element.equals(reader.getName())) { - return reader.getAttributeValue(null, attribute); - } else if (rootOnly) { - return null; - } - } - if (reader.hasNext()) { - eventType = reader.next(); - } else { - break; - } - } - return null; - } finally { - is.close(); - } - } - -} diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XSDDocumentProcessor.java b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XSDDocumentProcessor.java deleted file mode 100644 index 02c5593f86..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XSDDocumentProcessor.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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. - */ - -package org.apache.tuscany.sca.interfacedef.wsdl.xml; - -import java.net.URI; -import java.net.URL; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.service.ContributionReadException; -import org.apache.tuscany.sca.contribution.service.ContributionResolveException; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.XSDefinition; - -/** - * An ArtifactProcessor for XSD documents. - * - * @version $Rev$ $Date$ - */ -public class XSDDocumentProcessor implements URLArtifactProcessor { - - private WSDLFactory factory; - - public XSDDocumentProcessor(ModelFactoryExtensionPoint modelFactories) { - this.factory = modelFactories.getFactory(WSDLFactory.class); - } - - public XSDefinition read(URL contributionURL, URI artifactURI, URL artifactURL) throws ContributionReadException { - try { - return indexRead(artifactURL); - } catch (Exception e) { - throw new ContributionReadException(e); - } - } - - public void resolve(XSDefinition model, ModelResolver resolver) throws ContributionResolveException { - } - - public String getArtifactType() { - return ".xsd"; - } - - public Class getModelType() { - return XSDefinition.class; - } - - public static final QName XSD = new QName("http://www.w3.org/2001/XMLSchema", "schema"); - - protected XSDefinition indexRead(URL doc) throws Exception { - XSDefinition xsd = factory.createXSDefinition(); - xsd.setUnresolved(true); - xsd.setNamespace(XMLDocumentHelper.readTargetNamespace(doc, XSD, true, "targetNamespace")); - xsd.setLocation(doc.toURI()); - xsd.setUnresolved(false); - return xsd; - } -} diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XSDModelResolver.java b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XSDModelResolver.java deleted file mode 100644 index e74467c8b8..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XSDModelResolver.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * 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. - */ - -package org.apache.tuscany.sca.interfacedef.wsdl.xml; - -import java.io.IOException; -import java.net.URL; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.sca.contribution.Contribution; -import org.apache.tuscany.sca.contribution.DeployedArtifact; -import org.apache.tuscany.sca.contribution.Import; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.namespace.NamespaceImport; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.service.ContributionRuntimeException; -import org.apache.tuscany.sca.interfacedef.wsdl.DefaultWSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.XSDefinition; -import org.apache.ws.commons.schema.XmlSchema; -import org.apache.ws.commons.schema.XmlSchemaCollection; -import org.apache.ws.commons.schema.XmlSchemaInclude; -import org.apache.ws.commons.schema.resolver.URIResolver; -import org.xml.sax.InputSource; - -/** - * A Model Resolver for XSD models. - * - * @version $Rev: 557916 $ $Date: 2007-07-20 01:04:40 -0700 (Fri, 20 Jul 2007) $ - */ -public class XSDModelResolver implements ModelResolver { - private WSDLFactory factory; - private Contribution contribution; - private Map> map = new HashMap>(); - private XmlSchemaCollection schemaCollection; - - public XSDModelResolver(Contribution contribution, ModelFactoryExtensionPoint modelFactories) { - this.contribution = contribution; - this.schemaCollection = new XmlSchemaCollection(); - schemaCollection.setSchemaResolver(new URIResolverImpl(contribution)); - this.factory = new DefaultWSDLFactory(); - } - - public void addModel(Object resolved) { - XSDefinition definition = (XSDefinition)resolved; - List list = map.get(definition.getNamespace()); - if (list == null) { - list = new ArrayList(); - map.put(definition.getNamespace(), list); - } - list.add(definition); - } - - public Object removeModel(Object resolved) { - XSDefinition definition = (XSDefinition)resolved; - List list = map.get(definition.getNamespace()); - if (list == null) { - return null; - } else { - return list.remove(definition); - } - } - - public T resolveModel(Class modelClass, T unresolved) { - - // Lookup a definition for the given namespace - String namespace = ((XSDefinition)unresolved).getNamespace(); - List list = map.get(namespace); - XSDefinition resolved; - try { - resolved = aggregate(list); - } catch (IOException e) { - throw new ContributionRuntimeException(e); - } - if (resolved != null && !resolved.isUnresolved()) { - return modelClass.cast(resolved); - } - - // No definition found, delegate the resolution to the imports - for (Import import_ : this.contribution.getImports()) { - if (import_ instanceof NamespaceImport) { - NamespaceImport namespaceImport = (NamespaceImport)import_; - if (namespaceImport.getNamespace().equals(namespace)) { - - // Delegate the resolution to the import resolver - resolved = - namespaceImport.getModelResolver().resolveModel(XSDefinition.class, (XSDefinition)unresolved); - if (!resolved.isUnresolved()) { - return modelClass.cast(resolved); - } - } - } - } - return modelClass.cast(unresolved); - } - - private void loadOnDemand(XSDefinition definition) throws IOException { - if (definition.getSchema() == null && definition.getLocation() != null) { - // Read an XSD document - InputSource xsd = XMLDocumentHelper.getInputSource(definition.getLocation().toURL()); - XmlSchema schema = schemaCollection.read(xsd, null); - definition.setSchema(schema); - } - } - - /** - * Create a facade XmlSchema which includes all the defintions - * - * @param definitions A list of the XmlSchema under the same target - * namespace - * @return The aggregated XmlSchema - */ - private XSDefinition aggregate(List definitions) throws IOException { - if (definitions == null || definitions.size() == 0) { - return null; - } - if (definitions.size() == 1) { - XSDefinition d = definitions.get(0); - loadOnDemand(d); - return d; - } - XSDefinition aggregated = factory.createXSDefinition(); - for (XSDefinition d : definitions) { - loadOnDemand(d); - } - String ns = definitions.get(0).getNamespace(); - XmlSchema facade = new XmlSchema(ns, schemaCollection); - - for (XmlSchema d : schemaCollection.getXmlSchemas()) { - if (ns.equals(d.getTargetNamespace())) { - XmlSchemaInclude include = new XmlSchemaInclude(); - include.setSchema(d); - include.setSourceURI(d.getSourceURI()); - include.setSchemaLocation(d.getSourceURI()); - facade.getIncludes().add(include); - facade.getItems().add(include); - } - } - aggregated.setUnresolved(true); - aggregated.setSchema(facade); - aggregated.setNamespace(ns); - aggregated.setUnresolved(false); - - // FIXME: [rfeng] This is hacky - definitions.clear(); - definitions.add(aggregated); - return aggregated; - } - - /** - * URI resolver implementation for xml schema - */ - public static class URIResolverImpl implements URIResolver { - private Contribution contribution; - - public URIResolverImpl(Contribution contribution) { - this.contribution = contribution; - } - - public org.xml.sax.InputSource resolveEntity(java.lang.String targetNamespace, - java.lang.String schemaLocation, - java.lang.String baseUri) { - try { - if (schemaLocation == null || schemaLocation.startsWith("/")) { - return null; - } - URL url = null; - if (schemaLocation.startsWith("/")) { - // The URI is relative to the contribution - String uri = schemaLocation.substring(1); - for (DeployedArtifact a : contribution.getArtifacts()) { - if (a.getURI().equals(uri)) { - url = new URL(a.getLocation()); - break; - } - } - } else { - url = new URL(new URL(baseUri), schemaLocation); - } - return XMLDocumentHelper.getInputSource(url); - } catch (IOException e) { - return null; - } - } - } - -} diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor deleted file mode 100644 index 9666a6dbd8..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor +++ /dev/null @@ -1,19 +0,0 @@ -# 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. - -# Implementation class for the artifact processor extension -org.apache.tuscany.sca.interfacedef.wsdl.xml.WSDLInterfaceProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#interface.wsdl,model=org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor deleted file mode 100644 index 15ae762172..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor +++ /dev/null @@ -1,20 +0,0 @@ -# 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. - -# Implementation class for the artifact processor extension -org.apache.tuscany.sca.interfacedef.wsdl.xml.WSDLDocumentProcessor;type=.wsdl,model=org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition -org.apache.tuscany.sca.interfacedef.wsdl.xml.XSDDocumentProcessor;type=.xsd,model=org.apache.tuscany.sca.interfacedef.wsdl.XSDefinition diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver deleted file mode 100644 index 9c663a14ce..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver +++ /dev/null @@ -1,19 +0,0 @@ -# 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. - -org.apache.tuscany.sca.interfacedef.wsdl.xml.WSDLModelResolver;model=org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition -org.apache.tuscany.sca.interfacedef.wsdl.xml.XSDModelResolver;model=org.apache.tuscany.sca.interfacedef.wsdl.XSDefinition diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/TestModelResolver.java b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/TestModelResolver.java deleted file mode 100644 index 3c160a3bfa..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/TestModelResolver.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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. - */ - -package org.apache.tuscany.sca.interfacedef.wsdl.introspect; - -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; - - -/** - * A default implementation of an artifact resolver, based on a map. - * - * @version $Rev$ $Date$ - */ -public class TestModelResolver implements ModelResolver { - private static final long serialVersionUID = -7826976465762296634L; - - private Map map = new HashMap(); - - public TestModelResolver() { - } - - public T resolveModel(Class modelClass, T unresolved) { - Object resolved = map.get(unresolved); - if (resolved != null) { - - // Return the resolved object - return modelClass.cast(resolved); - - } else { - - // Return the unresolved object - return unresolved; - } - } - - public void addModel(Object resolved) { - map.put(resolved, resolved); - } - - public Object removeModel(Object resolved) { - return map.remove(resolved); - } - -} diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java deleted file mode 100644 index 275f2fa8d8..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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. - */ - -package org.apache.tuscany.sca.interfacedef.wsdl.introspect; - -import java.net.URI; -import java.net.URL; -import java.util.List; - -import javax.wsdl.PortType; -import javax.xml.namespace.QName; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.sca.contribution.DefaultModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.interfacedef.util.XMLType; -import org.apache.tuscany.sca.interfacedef.wsdl.DefaultWSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface; -import org.apache.tuscany.sca.interfacedef.wsdl.xml.WSDLDocumentProcessor; -import org.apache.tuscany.sca.interfacedef.wsdl.xml.WSDLModelResolver; - -/** - * Test case for InterfaceWSDLIntrospectorImpl - */ -public class WSDLInterfaceIntrospectorTestCase extends TestCase { - private static final QName PORTTYPE_NAME = new QName("http://example.com/stockquote.wsdl", "StockQuotePortType"); - - private WSDLDocumentProcessor registry; - private WSDLFactory wsdlFactory; - private PortType portType; - private ModelResolver resolver; - private WSDLDefinition definition; - - /** - * @see junit.framework.TestCase#setUp() - */ - @Override - protected void setUp() throws Exception { - super.setUp(); - ModelFactoryExtensionPoint factories = new DefaultModelFactoryExtensionPoint(); - wsdlFactory = new DefaultWSDLFactory(); - factories.addFactory(wsdlFactory); - javax.wsdl.factory.WSDLFactory wsdl4jFactory = javax.wsdl.factory.WSDLFactory.newInstance(); - factories.addFactory(wsdl4jFactory); - registry = new WSDLDocumentProcessor(factories); - resolver = new TestModelResolver(); - URL url = getClass().getResource("../xml/stockquote.wsdl"); - definition = registry.read(null, new URI("stockquote.wsdl"), url); - WSDLModelResolver wsdlResolver = new WSDLModelResolver(null, factories); - wsdlResolver.addModel(definition); - definition = wsdlResolver.resolveModel(WSDLDefinition.class, definition); portType = definition.getDefinition().getPortType(PORTTYPE_NAME); - } - - @SuppressWarnings("unchecked") - public final void testIntrospectPortType() throws InvalidInterfaceException { - WSDLInterface contract = wsdlFactory.createWSDLInterface(portType, definition.getInlinedSchemas(), resolver); - Assert.assertEquals(contract.getName().getLocalPart(), "StockQuotePortType"); - List operations = contract.getOperations(); - Assert.assertEquals(1, operations.size()); - Operation operation = operations.get(0); - Assert.assertEquals("getLastTradePrice", operation.getName()); - DataType> inputType = operation.getInputType(); - Assert.assertEquals(1, inputType.getLogical().size()); - DataType returnType = operation.getOutputType(); - Assert.assertNotNull(returnType); - Assert.assertEquals(0, operation.getFaultTypes().size()); - // Assert.assertEquals(1, - // operation.getWrapper().getInputChildElements().size()); - // Assert.assertEquals(1, - // operation.getWrapper().getOutputChildElements().size()); - } - -} diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java deleted file mode 100644 index 91586f7440..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * 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. - */ - -package org.apache.tuscany.sca.interfacedef.wsdl.introspect; - -import java.net.URI; -import java.net.URL; -import java.util.List; - -import javax.wsdl.Operation; -import javax.wsdl.PortType; -import javax.xml.namespace.QName; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.sca.contribution.DefaultModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException; -import org.apache.tuscany.sca.interfacedef.util.XMLType; -import org.apache.tuscany.sca.interfacedef.wsdl.DefaultWSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.impl.WSDLOperationIntrospectorImpl; -import org.apache.tuscany.sca.interfacedef.wsdl.xml.WSDLDocumentProcessor; -import org.apache.tuscany.sca.interfacedef.wsdl.xml.WSDLModelResolver; - -/** - * Test case for WSDLOperation - */ -public class WSDLOperationIntrospectorTestCase extends TestCase { - private static final QName PORTTYPE_NAME = - new QName("http://example.com/stockquote.wsdl", "StockQuotePortType"); - - private WSDLDocumentProcessor processor; - private WSDLModelResolver wsdlResolver; - private ModelResolver resolver; - private WSDLFactory wsdlFactory; - - /** - * @see junit.framework.TestCase#setUp() - */ - @Override - protected void setUp() throws Exception { - super.setUp(); - wsdlFactory = new DefaultWSDLFactory(); - ModelFactoryExtensionPoint factories = new DefaultModelFactoryExtensionPoint(); - factories.addFactory(wsdlFactory); - javax.wsdl.factory.WSDLFactory wsdl4jFactory = javax.wsdl.factory.WSDLFactory.newInstance(); - factories.addFactory(wsdl4jFactory); - processor = new WSDLDocumentProcessor(factories); - wsdlResolver = new WSDLModelResolver(null, factories); - resolver = new TestModelResolver(); - } - - @SuppressWarnings("unchecked") - public final void testWrappedOperation() throws Exception { - URL url = getClass().getResource("../xml/stockquote.wsdl"); - WSDLDefinition definition = processor.read(null, new URI("stockquote.wsdl"), url); - wsdlResolver.addModel(definition); - definition = wsdlResolver.resolveModel(WSDLDefinition.class, definition); - PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME); - Operation operation = portType.getOperation("getLastTradePrice", null, null); - - WSDLOperationIntrospectorImpl op = new WSDLOperationIntrospectorImpl(wsdlFactory, operation, definition.getInlinedSchemas(), "org.w3c.dom.Node", resolver); - - DataType> inputType = op.getInputType(); - Assert.assertEquals(1, inputType.getLogical().size()); - DataType type = inputType.getLogical().get(0); - Assert.assertEquals(new QName("http://example.com/stockquote.xsd", "getLastTradePrice"), type.getLogical().getElementName()); - - DataType outputType = op.getOutputType(); - Assert.assertEquals(new QName("http://example.com/stockquote.xsd", "getLastTradePriceResponse"), - outputType.getLogical().getElementName()); - Assert.assertTrue(op.isWrapperStyle()); - - DataType> unwrappedInputType = op.getWrapper().getWrapperInfo().getUnwrappedInputType(); - List childTypes = unwrappedInputType.getLogical(); - Assert.assertEquals(1, childTypes.size()); - DataType childType = childTypes.get(0); - Assert.assertEquals(new QName(null, "tickerSymbol"), childType.getLogical().getElementName()); - - childType = op.getWrapper().getWrapperInfo().getUnwrappedOutputType(); - Assert.assertEquals(new QName(null, "price"), childType.getLogical().getElementName()); - } - - public final void testUnwrappedOperation() throws Exception { - URL url = getClass().getResource("../xml/unwrapped-stockquote.wsdl"); - WSDLDefinition definition = processor.read(null, new URI("unwrapped-stockquote.wsdl"), url); - wsdlResolver.addModel(definition); - definition = wsdlResolver.resolveModel(WSDLDefinition.class, definition); - PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME); - - Operation operation = portType.getOperation("getLastTradePrice1", null, null); - WSDLOperationIntrospectorImpl op = new WSDLOperationIntrospectorImpl(wsdlFactory, operation, definition.getInlinedSchemas(), "org.w3c.dom.Node", resolver); - Assert.assertFalse(op.isWrapperStyle()); - Assert.assertEquals(1, op.getInputType().getLogical().size()); - - operation = portType.getOperation("getLastTradePrice2", null, null); - op = new WSDLOperationIntrospectorImpl(wsdlFactory, operation, definition.getInlinedSchemas(), "org.w3c.dom.Node", resolver); - Assert.assertFalse(op.isWrapperStyle()); - Assert.assertEquals(2, op.getInputType().getLogical().size()); - } - - public final void testInvalidWSDL() throws Exception { - URL url = getClass().getResource("../xml/invalid-stockquote.wsdl"); - WSDLDefinition definition = processor.read(null, new URI("invalid-stockquote.wsdl"), url); - wsdlResolver.addModel(definition); - definition = wsdlResolver.resolveModel(WSDLDefinition.class, definition); - PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME); - - Operation operation = portType.getOperation("getLastTradePrice", null, null); - WSDLOperationIntrospectorImpl op = new WSDLOperationIntrospectorImpl(wsdlFactory, operation, definition.getInlinedSchemas(), "org.w3c.dom.Node", resolver); - - try { - op.isWrapperStyle(); - fail("InvalidWSDLException should have been thrown"); - } catch (InvalidInterfaceException e) { - // Expected - } - - } - -} diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java deleted file mode 100644 index 1960bcbca7..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * 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. - */ - -package org.apache.tuscany.sca.interfacedef.wsdl.introspect; - -import java.net.URI; -import java.net.URL; - -import javax.wsdl.Operation; -import javax.wsdl.PortType; -import javax.xml.namespace.QName; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.sca.contribution.DefaultModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.interfacedef.wsdl.DefaultWSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.impl.WSDLOperationIntrospectorImpl; -import org.apache.tuscany.sca.interfacedef.wsdl.xml.WSDLDocumentProcessor; -import org.apache.tuscany.sca.interfacedef.wsdl.xml.WSDLModelResolver; - -/** - * Test case for WSDLOperation - */ -public class WrapperStyleOperationTestCase extends TestCase { - private static final QName PORTTYPE_NAME = new QName("http://example.com/stockquote.wsdl", "StockQuotePortType"); - - private WSDLDocumentProcessor registry; - private ModelResolver resolver; - private WSDLFactory wsdlFactory; - private WSDLModelResolver wsdlResolver; - - /** - * @see junit.framework.TestCase#setUp() - */ - @Override - protected void setUp() throws Exception { - super.setUp(); - ModelFactoryExtensionPoint factories = new DefaultModelFactoryExtensionPoint(); - wsdlFactory = new DefaultWSDLFactory(); - factories.addFactory(wsdlFactory); - javax.wsdl.factory.WSDLFactory wsdl4jFactory = javax.wsdl.factory.WSDLFactory.newInstance(); - factories.addFactory(wsdl4jFactory); - registry = new WSDLDocumentProcessor(factories); - resolver = new TestModelResolver(); - wsdlResolver = new WSDLModelResolver(null, factories); - } - - public final void testWrappedOperation() throws Exception { - URL url = getClass().getResource("../xml/stockquote.wsdl"); - WSDLDefinition definition = registry.read(null, new URI("stockquote.wsdl"), url); - wsdlResolver.addModel(definition); - definition = wsdlResolver.resolveModel(WSDLDefinition.class, definition); - PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME); - Operation operation = portType.getOperation("getLastTradePrice", null, null); - WSDLOperationIntrospectorImpl op = new WSDLOperationIntrospectorImpl(wsdlFactory, operation, definition.getInlinedSchemas(), "org.w3c.dom.Node", resolver); - Assert.assertTrue(op.isWrapperStyle()); - Assert.assertEquals(1, op.getWrapper().getInputChildElements().size()); - Assert.assertEquals(1, op.getWrapper().getOutputChildElements().size()); - } - - public final void testUnwrappedOperation() throws Exception { - URL url = getClass().getResource("../xml/unwrapped-stockquote.wsdl"); - WSDLDefinition definition = registry.read(null, new URI("unwrapped-stockquote.wsdl"), url); - wsdlResolver.addModel(definition); - definition = wsdlResolver.resolveModel(WSDLDefinition.class, definition); - PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME); - Operation operation = portType.getOperation("getLastTradePrice1", null, null); - WSDLOperationIntrospectorImpl op = new WSDLOperationIntrospectorImpl(wsdlFactory, operation, definition.getInlinedSchemas(), "org.w3c.dom.Node", resolver); - Assert.assertFalse(op.isWrapperStyle()); - operation = portType.getOperation("getLastTradePrice2", null, null); - op = new WSDLOperationIntrospectorImpl(wsdlFactory, operation, definition.getInlinedSchemas(), "org.w3c.dom.Node", resolver); - Assert.assertFalse(op.isWrapperStyle()); - } - -} diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java deleted file mode 100644 index 839e31d3e6..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * 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. - */ - -package org.apache.tuscany.sca.interfacedef.wsdl.xml; - -import java.io.InputStream; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLOutputFactory; -import javax.xml.stream.XMLStreamReader; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.ComponentType; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.ConstrainingType; -import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory; -import org.apache.tuscany.sca.assembly.SCABindingFactory; -import org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl; -import org.apache.tuscany.sca.assembly.xml.ComponentTypeProcessor; -import org.apache.tuscany.sca.assembly.xml.CompositeProcessor; -import org.apache.tuscany.sca.assembly.xml.ConstrainingTypeProcessor; -import org.apache.tuscany.sca.binding.sca.impl.SCABindingFactoryImpl; -import org.apache.tuscany.sca.contribution.DefaultModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.impl.ContributionFactoryImpl; -import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; -import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl; -import org.apache.tuscany.sca.interfacedef.wsdl.DefaultWSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.apache.tuscany.sca.policy.DefaultPolicyFactory; -import org.apache.tuscany.sca.policy.PolicyFactory; - -/** - * Test reading WSDL interfaces. - * - * @version $Rev$ $Date$ - */ -public class ReadTestCase extends TestCase { - - XMLInputFactory inputFactory; - DefaultStAXArtifactProcessorExtensionPoint staxProcessors; - ExtensibleStAXArtifactProcessor staxProcessor; - private AssemblyFactory assemblyFactory; - private SCABindingFactory scaBindingFactory; - private PolicyFactory policyFactory; - private InterfaceContractMapper mapper; - - @Override - public void setUp() throws Exception { - ModelFactoryExtensionPoint modelFactories = new DefaultModelFactoryExtensionPoint(); - assemblyFactory = new DefaultAssemblyFactory(); - scaBindingFactory = new SCABindingFactoryImpl(); - policyFactory = new DefaultPolicyFactory(); - mapper = new InterfaceContractMapperImpl(); - inputFactory = XMLInputFactory.newInstance(); - staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(modelFactories); - staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance()); - - WSDLFactory wsdlFactory = new DefaultWSDLFactory(); - modelFactories.addFactory(wsdlFactory); - WSDLInterfaceProcessor wsdlProcessor = new WSDLInterfaceProcessor(modelFactories); - staxProcessors.addArtifactProcessor(wsdlProcessor); - } - - @Override - public void tearDown() throws Exception { - inputFactory = null; - staxProcessors = null; - policyFactory = null; - assemblyFactory = null; - mapper = null; - } - - public void testReadComponentType() throws Exception { - ComponentTypeProcessor componentTypeProcessor = new ComponentTypeProcessor(assemblyFactory, policyFactory, staxProcessor); - InputStream is = getClass().getResourceAsStream("CalculatorImpl.componentType"); - XMLStreamReader reader = inputFactory.createXMLStreamReader(is); - ComponentType componentType = componentTypeProcessor.read(reader); - assertNotNull(componentType); - - //new PrintUtil(System.out).print(componentType); - } - - public void testReadConstrainingType() throws Exception { - ConstrainingTypeProcessor constrainingTypeProcessor = new ConstrainingTypeProcessor(assemblyFactory, policyFactory, staxProcessor); - InputStream is = getClass().getResourceAsStream("CalculatorComponent.constrainingType"); - XMLStreamReader reader = inputFactory.createXMLStreamReader(is); - ConstrainingType constrainingType = constrainingTypeProcessor.read(reader); - assertNotNull(constrainingType); - - //new PrintUtil(System.out).print(constrainingType); - } - - public void testReadComposite() throws Exception { - CompositeProcessor compositeProcessor = new CompositeProcessor(new ContributionFactoryImpl(), assemblyFactory, policyFactory, mapper, staxProcessor); - InputStream is = getClass().getResourceAsStream("Calculator.composite"); - XMLStreamReader reader = inputFactory.createXMLStreamReader(is); - Composite composite = compositeProcessor.read(reader); - assertNotNull(composite); - - CompositeBuilderImpl compositeUtil = new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, mapper, null); - compositeUtil.build(composite); - - //new PrintUtil(System.out).print(composite); - } - -} diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java deleted file mode 100644 index 5385f12460..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * 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. - */ - -package org.apache.tuscany.sca.interfacedef.wsdl.xml; - -import java.net.URI; -import java.net.URL; -import java.util.List; - -import javax.wsdl.Import; -import javax.xml.namespace.QName; - -import junit.framework.Assert; - -import org.apache.tuscany.sca.contribution.DefaultModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.interfacedef.wsdl.DefaultWSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * @version $Rev$ $Date$ - */ -public class WSDLDocumentProcessorTestCase { - private WSDLDocumentProcessor processor; - private WSDLFactory wsdlFactory; - private javax.wsdl.factory.WSDLFactory wsdl4jFactory; - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - ModelFactoryExtensionPoint modelFactories = new DefaultModelFactoryExtensionPoint(); - wsdlFactory = new DefaultWSDLFactory(); - modelFactories.addFactory(wsdlFactory); - wsdl4jFactory = javax.wsdl.factory.WSDLFactory.newInstance(); - modelFactories.addFactory(wsdl4jFactory); - processor = new WSDLDocumentProcessor(modelFactories); - } - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception { - } - - @Test - public void testWSDL() throws Exception { - URL url = getClass().getResource("/wsdl/helloworld-service.wsdl"); - WSDLDefinition definition = processor.read(null, URI.create("wsdl/helloworld-service.wsdl"), url); - Assert.assertNull(definition.getDefinition()); - Assert.assertEquals("http://helloworld", definition.getNamespace()); - URL url1 = getClass().getResource("/wsdl/helloworld-interface.wsdl"); - WSDLDefinition definition1 = processor.read(null, URI.create("wsdl/helloworld-interface.wsdl"), url1); - Assert.assertNull(definition1.getDefinition()); - Assert.assertEquals("http://helloworld", definition1.getNamespace()); - ModelFactoryExtensionPoint factories = new DefaultModelFactoryExtensionPoint(); - factories.addFactory(wsdlFactory); - factories.addFactory(wsdl4jFactory); - WSDLModelResolver resolver = new WSDLModelResolver(null, factories); - resolver.addModel(definition); - resolver.addModel(definition1); - WSDLDefinition resolved = resolver.resolveModel(WSDLDefinition.class, definition); - List imports = (List)definition.getDefinition().getImports().get("http://helloworld"); - Assert.assertNotNull(imports); - Assert.assertNotNull(((Import)imports.get(0)).getDefinition()); - Assert.assertNotNull(resolved.getDefinition().getPortType(new QName("http://helloworld", "HelloWorld"))); - Assert.assertNotNull(resolved.getDefinition().getService(new QName("http://helloworld", "HelloWorldService"))); - } - -} diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.java b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.java deleted file mode 100644 index 3696c8f073..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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. - */ - -package org.apache.tuscany.sca.interfacedef.wsdl.xml; - -import java.net.URI; -import java.net.URL; - -import javax.xml.namespace.QName; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.contribution.DefaultModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.DefaultURLArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor; -import org.apache.tuscany.sca.interfacedef.wsdl.DefaultWSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; - -/** - * Test reading WSDL interfaces. - * - * @version $Rev$ $Date$ - */ -public class WSDLTestCase extends TestCase { - - private DefaultURLArtifactProcessorExtensionPoint documentProcessors; - private ExtensibleURLArtifactProcessor documentProcessor; - private WSDLModelResolver wsdlResolver; - - @Override - public void setUp() throws Exception { - documentProcessors = new DefaultURLArtifactProcessorExtensionPoint(new DefaultModelFactoryExtensionPoint()); - documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors); - - WSDLFactory wsdlFactory = new DefaultWSDLFactory(); - ModelFactoryExtensionPoint factories = new DefaultModelFactoryExtensionPoint(); - factories.addFactory(wsdlFactory); - javax.wsdl.factory.WSDLFactory wsdl4jFactory = javax.wsdl.factory.WSDLFactory.newInstance(); - factories.addFactory(wsdl4jFactory); - WSDLDocumentProcessor wsdlProcessor = new WSDLDocumentProcessor(factories); - documentProcessors.addArtifactProcessor(wsdlProcessor); - wsdlResolver = new WSDLModelResolver(null, factories); - } - - @Override - public void tearDown() throws Exception { - documentProcessors = null; - } - - public void testReadWSDLDocument() throws Exception { - URL url = getClass().getResource("example.wsdl"); - WSDLDefinition definition = documentProcessor.read(null, new URI("example.wsdl"), url, WSDLDefinition.class); - assertNotNull(definition); - assertNull(definition.getDefinition()); - assertEquals(definition.getNamespace(), "http://www.example.org"); - } - - public void testReadWSDLImports() throws Exception { - QName aBinding = new QName("http://helloworld", "HelloWorldSoapBinding"); - QName aPortType = new QName("http://helloworld", "HelloWorld"); - - URL url = getClass().getResource("test1.wsdl"); - WSDLDefinition test1Defn = documentProcessor.read(null, new URI("test1.wsdl"), url, WSDLDefinition.class); - assertNotNull(test1Defn); - wsdlResolver.addModel(test1Defn); - test1Defn = wsdlResolver.resolveModel(WSDLDefinition.class, test1Defn); - //binding is a part of test1.wsdl - assertNotNull(test1Defn.getDefinition().getBinding(aBinding)); - //porttype is part of test2.wsdl - assertNotNull(test1Defn.getDefinition().getPortType(aPortType)); - } - - public void testReadSameNamespaceWSDLDocument() throws Exception { - QName aBinding = new QName("http://helloworld", "HelloWorldSoapBinding"); - QName aPortType = new QName("http://helloworld", "HelloWorld"); - - URL url = getClass().getResource("test2.wsdl"); - WSDLDefinition test2Defn = documentProcessor.read(null, new URI("test2.wsdl"), url, WSDLDefinition.class); - assertNotNull(test2Defn); - wsdlResolver.addModel(test2Defn); - test2Defn = wsdlResolver.resolveModel(WSDLDefinition.class, test2Defn); - - //bindigs are a part of test1.wsdl so should not be found - assertNull(test2Defn.getDefinition().getBinding(aBinding)); - assertNotNull(test2Defn.getDefinition().getPortType(aPortType)); - - url = getClass().getResource("test1.wsdl"); - WSDLDefinition test1Defn = documentProcessor.read(null, new URI("test1.wsdl"), url, WSDLDefinition.class); - assertNotNull(test1Defn); - wsdlResolver.addModel(test1Defn); - - test1Defn = wsdlResolver.resolveModel(WSDLDefinition.class, test1Defn); - - assertNotNull(test1Defn.getDefinition().getPortType(aPortType)); - assertNotNull(test1Defn.getDefinition().getBinding(aBinding)); - } - -} diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.java b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.java deleted file mode 100644 index 3a9468216f..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * 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. - */ - -package org.apache.tuscany.sca.interfacedef.wsdl.xml; - -import java.io.ByteArrayOutputStream; -import java.io.InputStream; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLOutputFactory; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.ComponentType; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.ConstrainingType; -import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory; -import org.apache.tuscany.sca.assembly.xml.ComponentTypeProcessor; -import org.apache.tuscany.sca.assembly.xml.CompositeProcessor; -import org.apache.tuscany.sca.assembly.xml.ConstrainingTypeProcessor; -import org.apache.tuscany.sca.contribution.DefaultModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.impl.ContributionFactoryImpl; -import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; -import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl; -import org.apache.tuscany.sca.interfacedef.wsdl.DefaultWSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.apache.tuscany.sca.policy.DefaultPolicyFactory; -import org.apache.tuscany.sca.policy.PolicyFactory; - -/** - * Test reading/write WSDL interfaces. - * - * @version $Rev$ $Date$ - */ -public class WriteTestCase extends TestCase { - - XMLInputFactory inputFactory; - DefaultStAXArtifactProcessorExtensionPoint staxProcessors; - private ExtensibleStAXArtifactProcessor staxProcessor; - private AssemblyFactory factory; - private PolicyFactory policyFactory; - private InterfaceContractMapper mapper; - - @Override - public void setUp() throws Exception { - ModelFactoryExtensionPoint modelFactories = new DefaultModelFactoryExtensionPoint(); - factory = new DefaultAssemblyFactory(); - policyFactory = new DefaultPolicyFactory(); - mapper = new InterfaceContractMapperImpl(); - inputFactory = XMLInputFactory.newInstance(); - staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(modelFactories); - staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance()); - - staxProcessors.addArtifactProcessor(new CompositeProcessor(new ContributionFactoryImpl(), factory, policyFactory, mapper, staxProcessor)); - staxProcessors.addArtifactProcessor(new ComponentTypeProcessor(factory, policyFactory, staxProcessor)); - staxProcessors.addArtifactProcessor(new ConstrainingTypeProcessor(factory, policyFactory, staxProcessor)); - - WSDLFactory wsdlFactory = new DefaultWSDLFactory(); - modelFactories.addFactory(wsdlFactory); - WSDLInterfaceProcessor wsdlProcessor = new WSDLInterfaceProcessor(modelFactories); - staxProcessors.addArtifactProcessor(wsdlProcessor); - } - - @Override - public void tearDown() throws Exception { - inputFactory = null; - staxProcessors = null; - policyFactory = null; - factory = null; - mapper = null; - } - - public void testReadWriteComponentType() throws Exception { - InputStream is = getClass().getResourceAsStream("CalculatorImpl.componentType"); - ComponentType componentType = staxProcessor.read(is, ComponentType.class); - assertNotNull(componentType); - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - staxProcessor.write(componentType, bos); - } - - public void testReadWriteConstrainingType() throws Exception { - InputStream is = getClass().getResourceAsStream("CalculatorComponent.constrainingType"); - ConstrainingType constrainingType = staxProcessor.read(is, ConstrainingType.class); - assertNotNull(constrainingType); - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - staxProcessor.write(constrainingType, bos); - } - - public void testReadWriteComposite() throws Exception { - InputStream is = getClass().getResourceAsStream("Calculator.composite"); - Composite composite = staxProcessor.read(is, Composite.class); - assertNotNull(composite); - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - staxProcessor.write(composite, bos); - } - -} diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelperTestCase.java b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelperTestCase.java deleted file mode 100644 index e8fb4c6385..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelperTestCase.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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. - */ - -package org.apache.tuscany.sca.interfacedef.wsdl.xml; - -import java.net.URL; - -import junit.framework.Assert; - -import org.junit.Before; -import org.junit.Test; - -/** - * @version $Rev$ $Date$ - */ -public class XMLDocumentHelperTestCase { - private URL wsdl; - private URL xsd; - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - wsdl = getClass().getResource("/wsdl/helloworld-interface.wsdl"); - xsd = getClass().getResource("/xsd/greeting.xsd"); - } - - @Test - public void testReadTNS() throws Exception { - String tns = XMLDocumentHelper.readTargetNamespace(wsdl, XMLDocumentHelper.WSDL11, true, "targetNamespace"); - Assert.assertEquals("http://helloworld", tns); - String tns2 = XMLDocumentHelper.readTargetNamespace(xsd, XMLDocumentHelper.XSD, true, null); - Assert.assertEquals("http://greeting", tns2); - } - -} diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XSDDocumentProcessorTestCase.java b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XSDDocumentProcessorTestCase.java deleted file mode 100644 index 9d4ee87ece..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XSDDocumentProcessorTestCase.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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. - */ - -package org.apache.tuscany.sca.interfacedef.wsdl.xml; - -import java.net.URI; -import java.net.URL; - -import javax.xml.namespace.QName; - -import junit.framework.Assert; - -import org.apache.tuscany.sca.contribution.DefaultModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.interfacedef.wsdl.DefaultWSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.XSDefinition; -import org.apache.ws.commons.schema.XmlSchemaInclude; -import org.apache.ws.commons.schema.XmlSchemaObjectCollection; -import org.apache.ws.commons.schema.XmlSchemaType; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * @version $Rev$ $Date$ - */ -public class XSDDocumentProcessorTestCase { - private XSDDocumentProcessor processor; - private WSDLFactory wsdlFactory; - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - ModelFactoryExtensionPoint modelFactories = new DefaultModelFactoryExtensionPoint(); - wsdlFactory = new DefaultWSDLFactory(); - modelFactories.addFactory(wsdlFactory); - processor = new XSDDocumentProcessor(modelFactories); - } - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception { - } - - @Test - public void testXSD() throws Exception { - URL url = getClass().getResource("/xsd/greeting.xsd"); - XSDefinition definition = processor.read(null, URI.create("xsd/greeting.xsd"), url); - Assert.assertNull(definition.getSchema()); - Assert.assertEquals("http://greeting", definition.getNamespace()); - URL url1 = getClass().getResource("/xsd/name.xsd"); - XSDefinition definition1 = processor.read(null, URI.create("xsd/name.xsd"), url1); - Assert.assertNull(definition1.getSchema()); - Assert.assertEquals("http://greeting", definition1.getNamespace()); - ModelFactoryExtensionPoint factories = new DefaultModelFactoryExtensionPoint(); - factories.addFactory(wsdlFactory); - XSDModelResolver resolver = new XSDModelResolver(null, factories); - resolver.addModel(definition); - XSDefinition resolved = resolver.resolveModel(XSDefinition.class, definition); - XmlSchemaObjectCollection collection = resolved.getSchema().getIncludes(); - Assert.assertTrue(collection.getCount() == 1); - XmlSchemaType type = - ((XmlSchemaInclude)collection.getItem(0)).getSchema().getTypeByName(new QName("http://greeting", "Name")); - Assert.assertNotNull(type); - resolver.addModel(definition1); - resolved = resolver.resolveModel(XSDefinition.class, definition); - collection = resolved.getSchema().getIncludes(); - Assert.assertTrue(collection.getCount() == 2); - XmlSchemaType type1 = - ((XmlSchemaInclude)collection.getItem(0)).getSchema().getTypeByName(new QName("http://greeting", "Name")); - XmlSchemaType type2 = - ((XmlSchemaInclude)collection.getItem(1)).getSchema().getTypeByName(new QName("http://greeting", "Name")); - Assert.assertTrue(type1 != null || type2 != null); - } - -} diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/Calculator.composite b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/Calculator.composite deleted file mode 100644 index 875fdf35d2..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/Calculator.composite +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorComponent.constrainingType b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorComponent.constrainingType deleted file mode 100644 index 3eb81b61bd..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorComponent.constrainingType +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorImpl.componentType b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorImpl.componentType deleted file mode 100644 index aea7046a3d..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorImpl.componentType +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/example.wsdl b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/example.wsdl deleted file mode 100644 index 5e8e5dad0d..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/example.wsdl +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/invalid-stockquote.wsdl b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/invalid-stockquote.wsdl deleted file mode 100644 index ad81fc7867..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/invalid-stockquote.wsdl +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/ipo.xsd b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/ipo.xsd deleted file mode 100644 index 241ec15d36..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/ipo.xsd +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - International Purchase order schema for Example.com - Copyright 2000 Example.com. All rights reserved. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/stockquote.wsdl b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/stockquote.wsdl deleted file mode 100644 index 39cd5547d9..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/stockquote.wsdl +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.wsdl b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.wsdl deleted file mode 100644 index 8e26f7b4b5..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.wsdl +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.xsd b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.xsd deleted file mode 100644 index c2210f4a94..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.xsd +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test2.wsdl b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test2.wsdl deleted file mode 100644 index 529b395fd5..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test2.wsdl +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/unwrapped-stockquote.wsdl b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/unwrapped-stockquote.wsdl deleted file mode 100644 index 666a7e4069..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/unwrapped-stockquote.wsdl +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-interface.wsdl b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-interface.wsdl deleted file mode 100644 index 5e2c681d47..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-interface.wsdl +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-service.wsdl b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-service.wsdl deleted file mode 100644 index 0a7979e308..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-service.wsdl +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/xsd/greeting.xsd b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/xsd/greeting.xsd deleted file mode 100644 index 635ca25bfc..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/xsd/greeting.xsd +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/xsd/name.xsd b/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/xsd/name.xsd deleted file mode 100644 index 300de931ec..0000000000 --- a/branches/sca-java-0.99/modules/interface-wsdl-xml/src/test/resources/xsd/name.xsd +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file -- cgit v1.2.3