Author: veithen Date: Sat May 14 22:20:23 2011 New Revision: 1103244 URL: http://svn.apache.org/viewvc?rev=1103244&view=rev Log: Added a test case that reproduces the issue described in AXIS2-4353.
Added: axis/axis2/java/core/trunk/modules/kernel/test-zip/ axis/axis2/java/core/trunk/modules/kernel/test-zip/assembly.xml (with props) axis/axis2/java/core/trunk/modules/kernel/test-zip/test.wsdl axis/axis2/java/core/trunk/modules/kernel/test-zip/test.xsd axis/axis2/java/core/trunk/modules/kernel/test/org/apache/axis2/client/ axis/axis2/java/core/trunk/modules/kernel/test/org/apache/axis2/client/ServiceClientTest.java (with props) Modified: axis/axis2/java/core/trunk/modules/kernel/pom.xml Modified: axis/axis2/java/core/trunk/modules/kernel/pom.xml URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/pom.xml?rev=1103244&r1=1103243&r2=1103244&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/kernel/pom.xml (original) +++ axis/axis2/java/core/trunk/modules/kernel/pom.xml Sat May 14 22:20:23 2011 @@ -212,6 +212,25 @@ </execution> </executions> </plugin> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <executions> + <execution> + <id>generate-test-zip</id> + <phase>generate-test-resources</phase> + <goals> + <goal>single</goal> + </goals> + <configuration> + <descriptors> + <descriptor>test-zip/assembly.xml</descriptor> + </descriptors> + <finalName>test-zip</finalName> + <appendAssemblyId>false</appendAssemblyId> + </configuration> + </execution> + </executions> + </plugin> </plugins> </build> </project> Added: axis/axis2/java/core/trunk/modules/kernel/test-zip/assembly.xml URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/test-zip/assembly.xml?rev=1103244&view=auto ============================================================================== --- axis/axis2/java/core/trunk/modules/kernel/test-zip/assembly.xml (added) +++ axis/axis2/java/core/trunk/modules/kernel/test-zip/assembly.xml Sat May 14 22:20:23 2011 @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. + --> +<assembly> + <id>test-zip</id> + <formats> + <format>zip</format> + </formats> + <includeBaseDirectory>false</includeBaseDirectory> + <fileSets> + <fileSet> + <directory>test-zip</directory> + <outputDirectory>/</outputDirectory> + <excludes> + <exclude>assembly.xml</exclude> + </excludes> + </fileSet> + </fileSets> +</assembly> Propchange: axis/axis2/java/core/trunk/modules/kernel/test-zip/assembly.xml ------------------------------------------------------------------------------ svn:eol-style = native Added: axis/axis2/java/core/trunk/modules/kernel/test-zip/test.wsdl URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/test-zip/test.wsdl?rev=1103244&view=auto ============================================================================== --- axis/axis2/java/core/trunk/modules/kernel/test-zip/test.wsdl (added) +++ axis/axis2/java/core/trunk/modules/kernel/test-zip/test.wsdl Sat May 14 22:20:23 2011 @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. + --> +<definitions name="Echo" + targetNamespace="urn:test" + xmlns:tns="urn:test" + xmlns="http://schemas.xmlsoap.org/wsdl/" + xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"> + <types> + <schema xmlns="http://www.w3.org/2001/XMLSchema"> + <import namespace="urn:test" schemaLocation="test.xsd" /> + </schema> + </types> + + <message name="EchoRequest"> + <part name="echo" element="tns:Echo" /> + </message> + + <message name="EchoResponse"> + <part name="echoResponse" element="tns:EchoResponse" /> + </message> + + <portType name="EchoPort"> + <operation name="Echo"> + <input message="tns:EchoRequest" /> + <output message="tns:EchoResponse" /> + </operation> + </portType> + + <binding name="EchoBinding" type="tns:EchoPort"> + <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> + <operation name="Echo"> + <soap:operation soapAction="urn:test:echo" /> + <input> + <soap:body use="literal" /> + </input> + <output> + <soap:body use="literal" /> + </output> + </operation> + </binding> + + <service name="EchoService"> + <port name="EchoPort" binding="tns:EchoBinding"> + <soap:address location="http://localhost:8080/axis2/services/EchoService" /> + </port> + </service> +</definitions> Added: axis/axis2/java/core/trunk/modules/kernel/test-zip/test.xsd URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/test-zip/test.xsd?rev=1103244&view=auto ============================================================================== --- axis/axis2/java/core/trunk/modules/kernel/test-zip/test.xsd (added) +++ axis/axis2/java/core/trunk/modules/kernel/test-zip/test.xsd Sat May 14 22:20:23 2011 @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. + --> +<schema targetNamespace="urn:test" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:test"> + <complexType name="echo"> + <sequence> + <element name="text" type="string" nillable="true" /> + </sequence> + </complexType> + <complexType name="echoResponse"> + <sequence> + <element name="text" type="string" nillable="true" /> + </sequence> + </complexType> + <element name="Echo" type="tns:echo" /> + <element name="EchoResponse" type="tns:echoResponse" /> +</schema> Added: axis/axis2/java/core/trunk/modules/kernel/test/org/apache/axis2/client/ServiceClientTest.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/test/org/apache/axis2/client/ServiceClientTest.java?rev=1103244&view=auto ============================================================================== --- axis/axis2/java/core/trunk/modules/kernel/test/org/apache/axis2/client/ServiceClientTest.java (added) +++ axis/axis2/java/core/trunk/modules/kernel/test/org/apache/axis2/client/ServiceClientTest.java Sat May 14 22:20:23 2011 @@ -0,0 +1,50 @@ +/* + * 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.axis2.client; + +import java.io.File; +import java.net.URL; + +import javax.xml.namespace.QName; + +import org.apache.axis2.context.ConfigurationContext; +import org.apache.axis2.context.ConfigurationContextFactory; +import org.junit.Ignore; +import org.junit.Test; + +public class ServiceClientTest { + /** + * Tests that imported schemas are correctly resolved if the WSDL is loaded from a ZIP file. + * This is a regression test for AXIS2-4353 and checks that WSDLs (with imports) can be loaded + * from the class path (which usually means a JAR file). + * + * @throws Exception + */ + @Test @Ignore + public void testWSDLWithImportsFromZIP() throws Exception { + ConfigurationContext configContext = ConfigurationContextFactory.createEmptyConfigurationContext(); + String basedir = System.getProperty("basedir"); + if (basedir == null) { + basedir = "."; + } + URL zipUrl = new File(basedir, "target/test-zip.zip").toURL(); + URL wsdlUrl = new URL("jar:" + zipUrl + "!/test.wsdl"); + new ServiceClient(configContext, wsdlUrl, new QName("urn:test", "EchoService"), "EchoPort"); + } +} Propchange: axis/axis2/java/core/trunk/modules/kernel/test/org/apache/axis2/client/ServiceClientTest.java ------------------------------------------------------------------------------ svn:eol-style = native