This is an automated email from the ASF dual-hosted git repository. billblough pushed a commit to branch 1_6 in repository https://gitbox.apache.org/repos/asf/axis-axis2-java-core.git
commit 82c7e753a8601839e1e637bb60c93b47e63e51a1 Author: Andreas Veithen <veit...@apache.org> AuthorDate: Sun Feb 14 23:27:07 2016 +0000 AXIS2-5741: Merge r1730369 and r1730427 to the 1.6 branch and enable the unit test (The regression is in 1.7.0). --- modules/adb-tests/pom.xml | 61 +++- .../axis2/databinding/axis2_5741/ServiceTest.java | 51 ++++ .../axis2_5741/service/FiverxLinkServiceImpl.java | 34 +++ modules/adb-tests/src/test/wsdl/AXIS2-5741.wsdl | 309 +++++++++++++++++++++ modules/adb-tests/src/test/xslt/AXIS2-5741.xsl | 11 + 5 files changed, 464 insertions(+), 2 deletions(-) diff --git a/modules/adb-tests/pom.xml b/modules/adb-tests/pom.xml index 46d24ea..43a11ef 100644 --- a/modules/adb-tests/pom.xml +++ b/modules/adb-tests/pom.xml @@ -79,15 +79,58 @@ <version>${project.version}</version> <executions> <execution> + <id>wsdl2code-mtom</id> <phase>generate-test-sources</phase> <goals> <goal>wsdl2code</goal> </goals> <configuration> <wsdlFile>src/test/wsdl/MTOMService.wsdl</wsdlFile> - <databindingName>adb</databindingName> <syncMode>sync</syncMode> <packageName>org.apache.axis2.databinding.mtom.client</packageName> + <outputDirectory>${project.build.directory}/wsdl2code/mtom</outputDirectory> + </configuration> + </execution> + <execution> + <id>wsdl2code-axis2-5741</id> + <phase>generate-test-sources</phase> + <goals> + <goal>wsdl2code</goal> + </goals> + <configuration> + <wsdlFile>src/test/wsdl/AXIS2-5741.wsdl</wsdlFile> + <packageName>org.apache.axis2.databinding.axis2_5741.service</packageName> + <generateServerSide>true</generateServerSide> + <generateServicesXml>true</generateServicesXml> + <outputDirectory>${project.build.directory}/wsdl2code/AXIS2-5741</outputDirectory> + </configuration> + </execution> + </executions> + <configuration> + <databindingName>adb</databindingName> + </configuration> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>xml-maven-plugin</artifactId> + <version>1.0.1</version> + <executions> + <execution> + <phase>generate-test-resources</phase> + <goals> + <goal>transform</goal> + </goals> + <configuration> + <transformationSets> + <transformationSet> + <dir>${project.build.directory}/wsdl2code/AXIS2-5741/resources</dir> + <includes> + <include>services.xml</include> + </includes> + <stylesheet>src/test/xslt/AXIS2-5741.xsl</stylesheet> + <outputDir>${project.build.directory}/repo/AXIS2-5741/services/FiverxLinkService/META-INF</outputDir> + </transformationSet> + </transformationSets> </configuration> </execution> </executions> @@ -98,6 +141,7 @@ <version>2.4.1</version> <executions> <execution> + <id>wsimport-mtom</id> <goals> <goal>wsimport-test</goal> </goals> @@ -108,6 +152,18 @@ <packageName>org.apache.axis2.databinding.mtom.service</packageName> </configuration> </execution> + <execution> + <id>wsimport-axis2-5741</id> + <goals> + <goal>wsimport-test</goal> + </goals> + <configuration> + <wsdlFiles> + <wsdlFile>${basedir}/src/test/wsdl/AXIS2-5741.wsdl</wsdlFile> + </wsdlFiles> + <packageName>org.apache.axis2.databinding.axis2_5741.client</packageName> + </configuration> + </execution> </executions> <dependencies> <dependency> @@ -128,7 +184,8 @@ </goals> <configuration> <sources> - <source>${project.build.directory}/generated-sources/axis2/wsdl2code/src</source> + <source>${project.build.directory}/wsdl2code/mtom/src</source> + <source>${project.build.directory}/wsdl2code/AXIS2-5741/src</source> </sources> </configuration> </execution> diff --git a/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5741/ServiceTest.java b/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5741/ServiceTest.java new file mode 100644 index 0000000..23caa81 --- /dev/null +++ b/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5741/ServiceTest.java @@ -0,0 +1,51 @@ +/* + * 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.databinding.axis2_5741; + +import static com.google.common.truth.Truth.assertThat; + +import javax.xml.ws.BindingProvider; + +import org.apache.axiom.testutils.PortAllocator; +import org.apache.axis2.context.ConfigurationContext; +import org.apache.axis2.context.ConfigurationContextFactory; +import org.apache.axis2.databinding.axis2_5741.client.FiverxLinkService; +import org.apache.axis2.databinding.axis2_5741.client.FiverxLinkService_Service; +import org.apache.axis2.transport.http.SimpleHTTPServer; +import org.junit.Test; + +public class ServiceTest { + @Test + public void test() throws Exception { + int port = PortAllocator.allocatePort(); + ConfigurationContext configurationContext = + ConfigurationContextFactory.createConfigurationContextFromFileSystem("target/repo/AXIS2-5741"); + SimpleHTTPServer server = new SimpleHTTPServer(configurationContext, port); + server.start(); + try { + FiverxLinkService client = new FiverxLinkService_Service().getFiverxLinkServicePort(); + ((BindingProvider)client).getRequestContext().put( + BindingProvider.ENDPOINT_ADDRESS_PROPERTY, + "http://localhost:" + port + "/axis2/services/FiverxLinkService"); + assertThat(client.ladeRzVersion("test")).isEqualTo("test result"); + } finally { + server.stop(); + } + } +} diff --git a/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5741/service/FiverxLinkServiceImpl.java b/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5741/service/FiverxLinkServiceImpl.java new file mode 100644 index 0000000..3d3057a --- /dev/null +++ b/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5741/service/FiverxLinkServiceImpl.java @@ -0,0 +1,34 @@ +/* + * 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.databinding.axis2_5741.service; + +import de.fiverx.spec.abrechnungsservice.types.LadeRzVersionE; +import de.fiverx.spec.abrechnungsservice.types.LadeRzVersionResponse; +import de.fiverx.spec.abrechnungsservice.types.LadeRzVersionResponseE; + +public class FiverxLinkServiceImpl extends FiverxLinkServiceSkeleton { + @Override + public LadeRzVersionResponseE ladeRzVersion(LadeRzVersionE ladeRzVersion) { + LadeRzVersionResponseE ladeRzVersionResponseE = new LadeRzVersionResponseE(); + LadeRzVersionResponse ladeRzVersionResponse = new LadeRzVersionResponse(); + ladeRzVersionResponseE.setLadeRzVersionResponse(ladeRzVersionResponse); + ladeRzVersionResponse.setResult("test result"); + return ladeRzVersionResponseE; + } +} diff --git a/modules/adb-tests/src/test/wsdl/AXIS2-5741.wsdl b/modules/adb-tests/src/test/wsdl/AXIS2-5741.wsdl new file mode 100644 index 0000000..c370258 --- /dev/null +++ b/modules/adb-tests/src/test/wsdl/AXIS2-5741.wsdl @@ -0,0 +1,309 @@ +<?xml version="1.0" encoding="UTF-8"?> +<definitions name="FiverxLinkService" targetNamespace="http://fiverx.de/spec/abrechnungsservice" + xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://fiverx.de/spec/abrechnungsservice/types" + xmlns:tns="http://fiverx.de/spec/abrechnungsservice" xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"> + <types> + <schema targetNamespace="http://fiverx.de/spec/abrechnungsservice/types" + xmlns="http://www.w3.org/2001/XMLSchema" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" + xmlns:tns="http://fiverx.de/spec/abrechnungsservice/types" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <complexType name="ladeRezepte"> + <sequence> + <element name="rzeParamLaden" nillable="true" type="string"/> + <element name="rzeParamVersion" nillable="true" type="string"/> + </sequence> + </complexType> + <complexType name="ladeRezepteResponse"> + <sequence> + <element name="result" nillable="true" type="string"/> + </sequence> + </complexType> + <complexType name="ladeRueckweisungen"> + <sequence> + <element name="rzeParamVersion" nillable="true" type="string"/> + </sequence> + </complexType> + <complexType name="ladeRueckweisungenResponse"> + <sequence> + <element name="result" nillable="true" type="string"/> + </sequence> + </complexType> + <complexType name="ladeRzDienste"> + <sequence> + <element name="rzeParamDienste" nillable="true" type="string"/> + <element name="rzeParamVersion" nillable="true" type="string"/> + </sequence> + </complexType> + <complexType name="ladeRzDiensteResponse"> + <sequence> + <element name="result" nillable="true" type="string"/> + </sequence> + </complexType> + <complexType name="ladeRzVersion"> + <sequence> + <element name="rzeParamLadeVersion" nillable="true" type="string"/> + </sequence> + </complexType> + <complexType name="ladeRzVersionResponse"> + <sequence> + <element name="result" nillable="true" type="string"/> + </sequence> + </complexType> + <complexType name="ladeStatusRezept"> + <sequence> + <element name="rzeParamStatus" nillable="true" type="string"/> + <element name="rzeParamVersion" nillable="true" type="string"/> + </sequence> + </complexType> + <complexType name="ladeStatusRezeptResponse"> + <sequence> + <element name="result" nillable="true" type="string"/> + </sequence> + </complexType> + <complexType name="pruefeRezept"> + <sequence> + <element name="rzePruefung" nillable="true" type="string"/> + <element name="rzeParamVersion" nillable="true" type="string"/> + </sequence> + </complexType> + <complexType name="pruefeRezeptResponse"> + <sequence> + <element name="result" nillable="true" type="string"/> + </sequence> + </complexType> + <complexType name="sendeRezepte"> + <sequence> + <element name="rzeLeistung" nillable="true" type="string"/> + <element name="rzeParamVersion" nillable="true" type="string"/> + </sequence> + </complexType> + <complexType name="sendeRezepteResponse"> + <sequence> + <element name="result" nillable="true" type="string"/> + </sequence> + </complexType> + <complexType name="storniereRezept"> + <sequence> + <element name="rzeParamStorno" nillable="true" type="string"/> + <element name="rzeParamVersion" nillable="true" type="string"/> + </sequence> + </complexType> + <complexType name="storniereRezeptResponse"> + <sequence> + <element name="result" nillable="true" type="string"/> + </sequence> + </complexType> + <element name="ladeRezepte" type="tns:ladeRezepte"/> + <element name="ladeRezepteResponse" type="tns:ladeRezepteResponse"/> + <element name="ladeRueckweisungen" type="tns:ladeRueckweisungen"/> + <element name="ladeRueckweisungenResponse" type="tns:ladeRueckweisungenResponse"/> + <element name="ladeRzDienste" type="tns:ladeRzDienste"/> + <element name="ladeRzDiensteResponse" type="tns:ladeRzDiensteResponse"/> + <element name="ladeRzVersion" type="tns:ladeRzVersion"/> + <element name="ladeRzVersionResponse" type="tns:ladeRzVersionResponse"/> + <element name="ladeStatusRezept" type="tns:ladeStatusRezept"/> + <element name="ladeStatusRezeptResponse" type="tns:ladeStatusRezeptResponse"/> + <element name="pruefeRezept" type="tns:pruefeRezept"/> + <element name="pruefeRezeptResponse" type="tns:pruefeRezeptResponse"/> + <element name="sendeRezepte" type="tns:sendeRezepte"/> + <element name="sendeRezepteResponse" type="tns:sendeRezepteResponse"/> + <element name="storniereRezept" type="tns:storniereRezept"/> + <element name="storniereRezeptResponse" type="tns:storniereRezeptResponse"/> + </schema> + </types> + <message name="FiverxLinkService_ladeRzDiensteResponse"> + <part name="result" element="ns1:ladeRzDiensteResponse"> + </part> + </message> + <message name="FiverxLinkService_ladeRzVersionResponse"> + <part name="result" element="ns1:ladeRzVersionResponse"> + </part> + </message> + <message name="FiverxLinkService_storniereRezeptResponse"> + <part name="result" element="ns1:storniereRezeptResponse"> + </part> + </message> + <message name="FiverxLinkService_ladeRezepte"> + <part name="parameters" element="ns1:ladeRezepte"> + </part> + </message> + <message name="FiverxLinkService_ladeRezepteResponse"> + <part name="result" element="ns1:ladeRezepteResponse"> + </part> + </message> + <message name="FiverxLinkService_sendeRezepteResponse"> + <part name="result" element="ns1:sendeRezepteResponse"> + </part> + </message> + <message name="FiverxLinkService_pruefeRezept"> + <part name="parameters" element="ns1:pruefeRezept"> + </part> + </message> + <message name="FiverxLinkService_pruefeRezeptResponse"> + <part name="result" element="ns1:pruefeRezeptResponse"> + </part> + </message> + <message name="FiverxLinkService_storniereRezept"> + <part name="parameters" element="ns1:storniereRezept"> + </part> + </message> + <message name="FiverxLinkService_ladeRueckweisungen"> + <part name="parameters" element="ns1:ladeRueckweisungen"> + </part> + </message> + <message name="FiverxLinkService_ladeStatusRezeptResponse"> + <part name="result" element="ns1:ladeStatusRezeptResponse"> + </part> + </message> + <message name="FiverxLinkService_sendeRezepte"> + <part name="parameters" element="ns1:sendeRezepte"> + </part> + </message> + <message name="FiverxLinkService_ladeStatusRezept"> + <part name="parameters" element="ns1:ladeStatusRezept"> + </part> + </message> + <message name="FiverxLinkService_ladeRueckweisungenResponse"> + <part name="result" element="ns1:ladeRueckweisungenResponse"> + </part> + </message> + <message name="FiverxLinkService_ladeRzVersion"> + <part name="parameters" element="ns1:ladeRzVersion"> + </part> + </message> + <message name="FiverxLinkService_ladeRzDienste"> + <part name="parameters" element="ns1:ladeRzDienste"> + </part> + </message> + <portType name="FiverxLinkService"> + <operation name="ladeRezepte"> + <input message="tns:FiverxLinkService_ladeRezepte"> + </input> + <output message="tns:FiverxLinkService_ladeRezepteResponse"> + </output> + </operation> + <operation name="ladeRueckweisungen"> + <input message="tns:FiverxLinkService_ladeRueckweisungen"> + </input> + <output message="tns:FiverxLinkService_ladeRueckweisungenResponse"> + </output> + </operation> + <operation name="ladeRzDienste"> + <input message="tns:FiverxLinkService_ladeRzDienste"> + </input> + <output message="tns:FiverxLinkService_ladeRzDiensteResponse"> + </output> + </operation> + <operation name="ladeRzVersion"> + <input message="tns:FiverxLinkService_ladeRzVersion"> + </input> + <output message="tns:FiverxLinkService_ladeRzVersionResponse"> + </output> + </operation> + <operation name="ladeStatusRezept"> + <input message="tns:FiverxLinkService_ladeStatusRezept"> + </input> + <output message="tns:FiverxLinkService_ladeStatusRezeptResponse"> + </output> + </operation> + <operation name="pruefeRezept"> + <input message="tns:FiverxLinkService_pruefeRezept"> + </input> + <output message="tns:FiverxLinkService_pruefeRezeptResponse"> + </output> + </operation> + <operation name="sendeRezepte"> + <input message="tns:FiverxLinkService_sendeRezepte"> + </input> + <output message="tns:FiverxLinkService_sendeRezepteResponse"> + </output> + </operation> + <operation name="storniereRezept"> + <input message="tns:FiverxLinkService_storniereRezept"> + </input> + <output message="tns:FiverxLinkService_storniereRezeptResponse"> + </output> + </operation> + </portType> + <binding name="FiverxLinkServiceBinding" type="tns:FiverxLinkService"> + <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="ladeRezepte"> + <soap:operation soapAction=""/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + </operation> + <operation name="ladeRueckweisungen"> + <soap:operation soapAction=""/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + </operation> + <operation name="ladeRzDienste"> + <soap:operation soapAction=""/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + </operation> + <operation name="ladeRzVersion"> + <soap:operation soapAction=""/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + </operation> + <operation name="ladeStatusRezept"> + <soap:operation soapAction=""/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + </operation> + <operation name="pruefeRezept"> + <soap:operation soapAction=""/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + </operation> + <operation name="sendeRezepte"> + <soap:operation soapAction=""/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + </operation> + <operation name="storniereRezept"> + <soap:operation soapAction=""/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + </operation> + </binding> + <service name="FiverxLinkService"> + <port name="FiverxLinkServicePort" binding="tns:FiverxLinkServiceBinding"> + <soap:address location="REPLACE_WITH_ACTUAL_URL"/> + </port> + </service> +</definitions> diff --git a/modules/adb-tests/src/test/xslt/AXIS2-5741.xsl b/modules/adb-tests/src/test/xslt/AXIS2-5741.xsl new file mode 100644 index 0000000..4801e07 --- /dev/null +++ b/modules/adb-tests/src/test/xslt/AXIS2-5741.xsl @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:template match="/serviceGroup/service[@name='FiverxLinkService']/parameter[@name='ServiceClass']/text()"> + org.apache.axis2.databinding.axis2_5741.service.FiverxLinkServiceImpl + </xsl:template> + <xsl:template match="@*|node()"> + <xsl:copy> + <xsl:apply-templates select="@*|node()"/> + </xsl:copy> + </xsl:template> +</xsl:stylesheet>