Author: veithen Date: Sun Mar 14 10:22:37 2010 New Revision: 922805 URL: http://svn.apache.org/viewvc?rev=922805&view=rev Log: Java2WSDL Ant task: added a test for package-namespace mappings.
Added: axis/axis2/java/core/trunk/modules/tool/axis2-ant-plugin/src/test/java/test/MyClass.java (with props) Modified: axis/axis2/java/core/trunk/modules/tool/axis2-ant-plugin/pom.xml axis/axis2/java/core/trunk/modules/tool/axis2-ant-plugin/src/test/java/test/Service.java Modified: axis/axis2/java/core/trunk/modules/tool/axis2-ant-plugin/pom.xml URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/tool/axis2-ant-plugin/pom.xml?rev=922805&r1=922804&r2=922805&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/tool/axis2-ant-plugin/pom.xml (original) +++ axis/axis2/java/core/trunk/modules/tool/axis2-ant-plugin/pom.xml Sun Mar 14 10:22:37 2010 @@ -126,6 +126,8 @@ </classpath> </taskdef> + <echo message="Generating extraclasses*.wsdl"/> + <java2wsdl className="test.Service" outputLocation="${project.build.directory}/java2wsdl" outputFileName="extraclasses1.wsdl"> @@ -144,6 +146,15 @@ extraClasses="test.ExtraClass1"> <extraclass name="test.ExtraClass2"/> </java2wsdl> + + <echo message="Generating mappings.wsdl"/> + + <java2wsdl className="test.Service" + outputLocation="${project.build.directory}/java2wsdl" + outputFileName="mappings.wsdl" + schemaTargetNamespace="http://www.example.org/schema/test-service"> + <mapping package="test" namespace="http://www.example.org/schema/test"/> + </java2wsdl> </tasks> </configuration> </execution> @@ -167,12 +178,21 @@ def wsdl = new Namespace('http://schemas.xmlsoap.org/wsdl/') def xs = new Namespace('http://www.w3.org/2001/XMLSchema') + println 'Checking extraclasses*.wsdl' + for (i in 1..3) { def wsdlDoc = parser.parse(new File(project.build.directory, "java2wsdl/extraclasses${i}.wsdl")) def complexTypes = wsdlDoc[wsdl.types][xs.schema][xs.complexType].'@name' assert complexTypes.contains('ExtraClass1') assert complexTypes.contains('ExtraClass2') } + + println 'Checking mappings.wsdl' + + def wsdlDoc = parser.parse(new File(project.build.directory, "java2wsdl/mappings.wsdl")) + def namespaces = wsdlDoc[wsdl.types][xs.schema].'@targetNamespace' + assert namespaces.contains('http://www.example.org/schema/test-service') + assert namespaces.contains('http://www.example.org/schema/test') </source> </configuration> </execution> Added: axis/axis2/java/core/trunk/modules/tool/axis2-ant-plugin/src/test/java/test/MyClass.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/tool/axis2-ant-plugin/src/test/java/test/MyClass.java?rev=922805&view=auto ============================================================================== --- axis/axis2/java/core/trunk/modules/tool/axis2-ant-plugin/src/test/java/test/MyClass.java (added) +++ axis/axis2/java/core/trunk/modules/tool/axis2-ant-plugin/src/test/java/test/MyClass.java Sun Mar 14 10:22:37 2010 @@ -0,0 +1,31 @@ +/* + * 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 test; + +public class MyClass { + private String property; + + public String getProperty() { + return property; + } + + public void setProperty(String property) { + this.property = property; + } +} Propchange: axis/axis2/java/core/trunk/modules/tool/axis2-ant-plugin/src/test/java/test/MyClass.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: axis/axis2/java/core/trunk/modules/tool/axis2-ant-plugin/src/test/java/test/Service.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/tool/axis2-ant-plugin/src/test/java/test/Service.java?rev=922805&r1=922804&r2=922805&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/tool/axis2-ant-plugin/src/test/java/test/Service.java (original) +++ axis/axis2/java/core/trunk/modules/tool/axis2-ant-plugin/src/test/java/test/Service.java Sun Mar 14 10:22:37 2010 @@ -19,7 +19,7 @@ package test; public class Service { - public String echo(String in) { + public MyClass echo(MyClass in) { return in; } }