Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/builderSelectorTest/axis2.xml URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/builderSelectorTest/axis2.xml?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/builderSelectorTest/axis2.xml (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/builderSelectorTest/axis2.xml Sun Dec 17 22:34:08 2017 @@ -174,12 +174,12 @@ <transportSender name="local" class="org.apache.axis2.transport.local.LocalTransportSender"/> <transportSender name="http" - class="org.apache.axis2.transport.http.CommonsHTTPTransportSender"> + class="org.apache.axis2.transport.http.impl.httpclient4.HTTPClient4TransportSender"> <parameter name="PROTOCOL">HTTP/1.1</parameter> <parameter name="Transfer-Encoding">chunked</parameter> </transportSender> <transportSender name="https" - class="org.apache.axis2.transport.http.CommonsHTTPTransportSender"> + class="org.apache.axis2.transport.http.impl.httpclient4.HTTPClient4TransportSender"> <parameter name="PROTOCOL">HTTP/1.1</parameter> <parameter name="Transfer-Encoding">chunked</parameter> </transportSender>
Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/builderSelectorTest/bad-axis2.xml URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/builderSelectorTest/bad-axis2.xml?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/builderSelectorTest/bad-axis2.xml (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/builderSelectorTest/bad-axis2.xml Sun Dec 17 22:34:08 2017 @@ -162,12 +162,12 @@ <transportSender name="local" class="org.apache.axis2.transport.local.LocalTransportSender"/> <transportSender name="http" - class="org.apache.axis2.transport.http.CommonsHTTPTransportSender"> + class="org.apache.axis2.transport.http.impl.httpclient4.HTTPClient4TransportSender"> <parameter name="PROTOCOL">HTTP/1.1</parameter> <parameter name="Transfer-Encoding">chunked</parameter> </transportSender> <transportSender name="https" - class="org.apache.axis2.transport.http.CommonsHTTPTransportSender"> + class="org.apache.axis2.transport.http.impl.httpclient4.HTTPClient4TransportSender"> <parameter name="PROTOCOL">HTTP/1.1</parameter> <parameter name="Transfer-Encoding">chunked</parameter> </transportSender> Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/echo/build.xml URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/echo/build.xml?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/echo/build.xml (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/echo/build.xml Sun Dec 17 22:34:08 2017 @@ -21,11 +21,11 @@ <project basedir="." default="jar"> <property name="src" location="."/> - <property name="build" location="build"/> + <property name="root" location="../../../"/> + <property name="build" location="${root}/target/build"/> <property name="build.classes" location="${build}/classes"/> <property name="build.lib" location="${build}/lib"/> <property name="lib" location="lib"/> - <property name="root" location="../../../"/> <property name="jar.dir" location="${root}/target/echo"/> <path id="axis.test.classpath"> @@ -36,7 +36,7 @@ <target name="compile" depends="init" unless="jars.uptodate"> <mkdir dir="${build.classes}"/> <mkdir dir="${build.lib}"/> - <javac destdir="${build.classes}" debug="on"> + <javac destdir="${build.classes}" debug="on" fork="true"> <classpath refid="axis.test.classpath"/> <src path="${src}"/> </javac> Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/hostConfigrepo/axis2.xml URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/hostConfigrepo/axis2.xml?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/hostConfigrepo/axis2.xml (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/hostConfigrepo/axis2.xml Sun Dec 17 22:34:08 2017 @@ -79,11 +79,11 @@ <transportSender name="tcp" class="org.apache.axis2.transport.tcp.TCPTransportSender"/> <transportSender name="local" class="org.apache.axis2.transport.local.LocalTransportSender"/> - <transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender"> + <transportSender name="http" class="org.apache.axis2.transport.http.impl.httpclient4.HTTPClient4TransportSender"> <parameter name="PROTOCOL">HTTP/1.1</parameter> </transportSender> <transportSender name="https" - class="org.apache.axis2.transport.http.CommonsHTTPTransportSender"> + class="org.apache.axis2.transport.http.impl.httpclient4.HTTPClient4TransportSender"> <parameter name="PROTOCOL">HTTP/1.1</parameter> </transportSender> Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/invalidservice/build.xml URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/invalidservice/build.xml?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/invalidservice/build.xml (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/invalidservice/build.xml Sun Dec 17 22:34:08 2017 @@ -21,11 +21,11 @@ <project basedir="." default="jar"> <property name="src" location="."/> - <property name="build" location="build"/> + <property name="root" location="../../../"/> + <property name="build" location="${root}/target/build"/> <property name="build.classes" location="${build}/classes"/> <property name="build.lib" location="${build}/lib"/> <property name="lib" location="lib"/> - <property name="root" location="../../../"/> <property name="jar.dir" location="${root}/target/test-resources/InvalidDeployment/services/"/> <path id="axis.test.classpath"> @@ -37,7 +37,7 @@ <target name="compile" depends="init" unless="jars.uptodate"> <mkdir dir="${build.classes}"/> <mkdir dir="${build.lib}"/> - <javac destdir="${build.classes}" debug="on"> + <javac destdir="${build.classes}" debug="on" fork="true"> <classpath refid="axis.test.classpath"/> <src path="${src}"/> </javac> Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/messageFormatterTest/bad-axis2.xml URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/messageFormatterTest/bad-axis2.xml?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/messageFormatterTest/bad-axis2.xml (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/messageFormatterTest/bad-axis2.xml Sun Dec 17 22:34:08 2017 @@ -163,12 +163,12 @@ <transportSender name="local" class="org.apache.axis2.transport.local.LocalTransportSender"/> <transportSender name="http" - class="org.apache.axis2.transport.http.CommonsHTTPTransportSender"> + class="org.apache.axis2.transport.http.impl.httpclient4.HTTPClient4TransportSender"> <parameter name="PROTOCOL">HTTP/1.1</parameter> <parameter name="Transfer-Encoding">chunked</parameter> </transportSender> <transportSender name="https" - class="org.apache.axis2.transport.http.CommonsHTTPTransportSender"> + class="org.apache.axis2.transport.http.impl.httpclient4.HTTPClient4TransportSender"> <parameter name="PROTOCOL">HTTP/1.1</parameter> <parameter name="Transfer-Encoding">chunked</parameter> </transportSender> Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/module1/build.xml URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/module1/build.xml?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/module1/build.xml (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/module1/build.xml Sun Dec 17 22:34:08 2017 @@ -21,11 +21,11 @@ <project basedir="." default="jar"> <property name="src" location="."/> - <property name="build" location="build"/> + <property name="root" location="../../../"/> + <property name="build" location="${root}/target/build"/> <property name="build.classes" location="${build}/classes"/> <property name="build.lib" location="${build}/lib"/> <property name="lib" location="lib"/> - <property name="root" location="../../../"/> <property name="jar.dir" location="${root}/target/test-resources/deployment/modules/"/> <path id="axis.test.classpath"> @@ -36,7 +36,7 @@ <target name="compile" depends="init" unless="jars.uptodate"> <mkdir dir="${build.classes}"/> <mkdir dir="${build.lib}"/> - <javac destdir="${build.classes}" debug="on"> + <javac destdir="${build.classes}" debug="on" fork="true"> <classpath refid="axis.test.classpath"/> <src path="${src}"/> </javac> Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/server1.xml URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/server1.xml?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/server1.xml (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/server1.xml Sun Dec 17 22:34:08 2017 @@ -23,7 +23,7 @@ <messageReceiver mep="INOUT" class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/> - <transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender"> + <transportSender name="http" class="org.apache.axis2.transport.http.impl.httpclient4.HTTPClient4TransportSender"> <parameter name="PROTOCOL">HTTP/1.0</parameter> </transportSender> <module ref="addressing"/> Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/service2/build.xml URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/service2/build.xml?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/service2/build.xml (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/service2/build.xml Sun Dec 17 22:34:08 2017 @@ -21,11 +21,11 @@ <project basedir="." default="jar"> <property name="src" location="."/> - <property name="build" location="build"/> + <property name="root" location="../../../"/> + <property name="build" location="${root}/target/build"/> <property name="build.classes" location="${build}/classes"/> <property name="build.lib" location="${build}/lib"/> <property name="lib" location="lib"/> - <property name="root" location="../../../"/> <property name="jar.dir" location="${root}/target/test-resources/deployment/services/"/> <path id="axis.test.classpath"> @@ -36,7 +36,7 @@ <target name="compile" depends="init" unless="jars.uptodate"> <mkdir dir="${build.classes}"/> <mkdir dir="${build.lib}"/> - <javac destdir="${build.classes}" debug="on"> + <javac destdir="${build.classes}" debug="on" fork="true"> <classpath refid="axis.test.classpath"/> <src path="${src}"/> </javac> Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/serviceModule/build.xml URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/serviceModule/build.xml?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/serviceModule/build.xml (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/deployment/serviceModule/build.xml Sun Dec 17 22:34:08 2017 @@ -21,11 +21,11 @@ <project basedir="." default="jar"> <property name="src" location="."/> - <property name="build" location="build"/> + <property name="root" location="../../../"/> + <property name="build" location="${root}/target/build"/> <property name="build.classes" location="${build}/classes"/> <property name="build.lib" location="${build}/lib"/> <property name="lib" location="lib"/> - <property name="root" location="../../../"/> <property name="jar.dir" location="${root}/target/test-resources/InvalidDeployment/modules/"/> <path id="axis.test.classpath"> @@ -36,7 +36,7 @@ <target name="compile" depends="init" unless="jars.uptodate"> <mkdir dir="${build.classes}"/> <mkdir dir="${build.lib}"/> - <javac destdir="${build.classes}" debug="on"> + <javac destdir="${build.classes}" debug="on" fork="true"> <classpath refid="axis.test.classpath"/> <src path="${src}"/> </javac> Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/wsdl/actionTests.wsdl URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/wsdl/actionTests.wsdl?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/wsdl/actionTests.wsdl (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test-resources/wsdl/actionTests.wsdl Sun Dec 17 22:34:08 2017 @@ -77,6 +77,34 @@ <wsdl:fault name="echoFault" message="tns:echoechoFault1" wsaw:Action="http://example.org/action/echoFault"></wsdl:fault> </wsdl:operation> </wsdl:portType> + <wsdl:portType name="withWSAWActionURI"> + <wsdl:operation name="echo"> + <wsdl:input message="tns:echoRequest1" wsaw:Action="tns:actiontest/action/echoIn"></wsdl:input> + <wsdl:output message="tns:echoResponse1" wsaw:Action="tns:actiontest/action/echoOut"></wsdl:output> + <wsdl:fault name="echoFault" message="tns:echoechoFault1" wsaw:Action="tns:actiontest/action/echoFault"></wsdl:fault> + </wsdl:operation> + </wsdl:portType> + <wsdl:portType name="withWSAActionURI" xmlns:wsa="http://www.w3.org/2005/08/addressing"> + <wsdl:operation name="echo"> + <wsdl:input message="tns:echoRequest1" wsa:Action="tns:actiontest/action/echoIn"></wsdl:input> + <wsdl:output message="tns:echoResponse1" wsa:Action="tns:actiontest/action/echoOut"></wsdl:output> + <wsdl:fault name="echoFault" message="tns:echoechoFault1" wsa:Action="tns:actiontest/action/echoFault"></wsdl:fault> + </wsdl:operation> + </wsdl:portType> + <wsdl:portType name="withWSAMActionURI" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"> + <wsdl:operation name="echo"> + <wsdl:input message="tns:echoRequest1" wsam:Action="tns:actiontest/action/echoIn"></wsdl:input> + <wsdl:output message="tns:echoResponse1" wsam:Action="tns:actiontest/action/echoOut"></wsdl:output> + <wsdl:fault name="echoFault" message="tns:echoechoFault1" wsam:Action="tns:actiontest/action/echoFault"></wsdl:fault> + </wsdl:operation> + </wsdl:portType> + <wsdl:portType name="withWSASubmissionActionURI" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"> + <wsdl:operation name="echo"> + <wsdl:input message="tns:echoRequest1" wsa:Action="tns:actiontest/action/echoIn"></wsdl:input> + <wsdl:output message="tns:echoResponse1" wsa:Action="tns:actiontest/action/echoOut"></wsdl:output> + <wsdl:fault name="echoFault" message="tns:echoechoFault1" wsa:Action="tns:actiontest/action/echoFault"></wsdl:fault> + </wsdl:operation> + </wsdl:portType> <wsdl:portType name="withoutWSAWActionNoName"> <wsdl:operation name="echo"> <wsdl:input message="tns:echoRequest2"></wsdl:input> Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/addressing/EndpointReferenceHelperTest.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/addressing/EndpointReferenceHelperTest.java?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/addressing/EndpointReferenceHelperTest.java (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/addressing/EndpointReferenceHelperTest.java Sun Dec 17 22:34:08 2017 @@ -33,6 +33,11 @@ import java.util.ArrayList; import java.util.Map; public class EndpointReferenceHelperTest extends TestCase { + private void compareAttributes(OMAttribute expected, OMAttribute actual) { + assertEquals(expected.getNamespace(), actual.getNamespace()); + assertEquals(expected.getLocalName(), actual.getLocalName()); + assertEquals(expected.getAttributeValue(), actual.getAttributeValue()); + } public void testToAndFromOMForFinalSpecEPR() throws Exception { String address = "http://ws.apache.org/axis2"; @@ -77,19 +82,19 @@ public class EndpointReferenceHelperTest assertEquals(epr.getAddress(), deser.getAddress()); ArrayList addrAttrs = deser.getAddressAttributes(); - assertEquals(attr1, addrAttrs.get(0)); - assertEquals(attr2, addrAttrs.get(1)); + compareAttributes(attr1, (OMAttribute)addrAttrs.get(0)); + compareAttributes(attr2, (OMAttribute)addrAttrs.get(1)); ArrayList attrs = deser.getAttributes(); - assertEquals(attr1, attrs.get(0)); - assertEquals(attr2, attrs.get(1)); + compareAttributes(attr1, (OMAttribute)attrs.get(0)); + compareAttributes(attr2, (OMAttribute)attrs.get(1)); ArrayList metadata = deser.getMetaData(); assertEquals(md1, metadata.get(0)); assertEquals(md2, metadata.get(1)); ArrayList mdAttrs = deser.getMetadataAttributes(); - assertEquals(attr1, mdAttrs.get(0)); - assertEquals(attr2, mdAttrs.get(1)); + compareAttributes(attr1, (OMAttribute)mdAttrs.get(0)); + compareAttributes(attr2, (OMAttribute)mdAttrs.get(1)); ArrayList extelts = deser.getExtensibleElements(); assertEquals(ext1, extelts.get(0)); @@ -109,15 +114,15 @@ public class EndpointReferenceHelperTest assertEquals(attr2, addrAttrs.get(1)); attrs = deser.getAttributes(); - assertEquals(attr1, attrs.get(0)); - assertEquals(attr2, attrs.get(1)); + compareAttributes(attr1, (OMAttribute)attrs.get(0)); + compareAttributes(attr2, (OMAttribute)attrs.get(1)); metadata = deser.getMetaData(); assertEquals(md1, metadata.get(0)); assertEquals(md2, metadata.get(1)); mdAttrs = deser.getMetadataAttributes(); - assertEquals(attr1, mdAttrs.get(0)); - assertEquals(attr2, mdAttrs.get(1)); + compareAttributes(attr1, (OMAttribute)mdAttrs.get(0)); + compareAttributes(attr2, (OMAttribute)mdAttrs.get(1)); extelts = deser.getExtensibleElements(); assertEquals(ext1, extelts.get(0)); @@ -187,12 +192,12 @@ public class EndpointReferenceHelperTest assertEquals(epr.getAddress(), deser.getAddress()); ArrayList addrAttrs = deser.getAddressAttributes(); - assertEquals(attr1, addrAttrs.get(0)); - assertEquals(attr2, addrAttrs.get(1)); + compareAttributes(attr1, (OMAttribute)addrAttrs.get(0)); + compareAttributes(attr2, (OMAttribute)addrAttrs.get(1)); ArrayList attrs = deser.getAttributes(); - assertEquals(attr1, attrs.get(0)); - assertEquals(attr2, attrs.get(1)); + compareAttributes(attr1, (OMAttribute)attrs.get(0)); + compareAttributes(attr2, (OMAttribute)attrs.get(1)); //Metadata will be lost unless it is saved as an extensibility element. ArrayList metadata = deser.getMetaData(); @@ -216,12 +221,12 @@ public class EndpointReferenceHelperTest assertEquals(epr.getAddress(), deser.getAddress()); addrAttrs = deser.getAddressAttributes(); - assertEquals(attr1, addrAttrs.get(0)); - assertEquals(attr2, addrAttrs.get(1)); + compareAttributes(attr1, (OMAttribute)addrAttrs.get(0)); + compareAttributes(attr2, (OMAttribute)addrAttrs.get(1)); attrs = deser.getAttributes(); - assertEquals(attr1, attrs.get(0)); - assertEquals(attr2, attrs.get(1)); + compareAttributes(attr1, (OMAttribute)attrs.get(0)); + compareAttributes(attr2, (OMAttribute)attrs.get(1)); //Metadata will be lost unless it is saved as an extensibility element. metadata = deser.getMetaData(); Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/addressing/wsdl/WSDL11ActionHelperTest.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/addressing/wsdl/WSDL11ActionHelperTest.java?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/addressing/wsdl/WSDL11ActionHelperTest.java (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/addressing/wsdl/WSDL11ActionHelperTest.java Sun Dec 17 22:34:08 2017 @@ -21,6 +21,7 @@ package org.apache.axis2.addressing.wsdl import junit.framework.TestCase; import org.apache.axis2.AbstractTestCase; +import org.apache.axis2.wsdl.WSDLUtil; import javax.wsdl.Definition; import javax.wsdl.Fault; @@ -28,7 +29,6 @@ import javax.wsdl.Input; import javax.wsdl.Operation; import javax.wsdl.Output; import javax.wsdl.PortType; -import javax.wsdl.factory.WSDLFactory; import javax.wsdl.xml.WSDLReader; import javax.xml.namespace.QName; import java.io.File; @@ -43,12 +43,12 @@ public class WSDL11ActionHelperTest exte protected void setUp() throws Exception { super.setUp(); - WSDLReader reader = WSDLFactory.newInstance().newWSDLReader(); + WSDLReader reader = WSDLUtil.newWSDLReaderWithPopulatedExtensionRegistry(); reader.setFeature("javax.wsdl.importDocuments", false); reader.setFeature("javax.wsdl.verbose", false); URL wsdlFile = new File(AbstractTestCase.basedir + testWSDLFile) - .toURL();//getClass().getClassLoader().getResource(testWSDLFile); + .toURI().toURL();//getClass().getClassLoader().getResource(testWSDLFile); definition = reader.readWSDL(wsdlFile.toString()); } @@ -156,6 +156,158 @@ public class WSDL11ActionHelperTest exte List operations = pt.getOperations(); Operation op = (Operation) operations.get(0); Fault fault = op.getFault("echoFault"); + String actualAction = + WSDL11ActionHelper.getActionFromFaultElement(definition, pt, op, fault); + assertEquals(expectedAction, actualAction); + } + + // Test reading wsaw:Action values + // portType=withWSAWActionURI + // operation=echo + public void testGetWSAWInputActionURI() { + String expectedAction = "tns:actiontest/action/echoIn"; + PortType pt = definition + .getPortType(new QName("http://ws.apache.org/axis2/actiontest/", "withWSAWActionURI")); + List operations = pt.getOperations(); + Operation op = (Operation) operations.get(0); + Input in = op.getInput(); + String actualAction = WSDL11ActionHelper.getActionFromInputElement(definition, pt, op, in); + assertEquals(expectedAction, actualAction); + } + + public void testGetWSAWOutputActionURI() { + String expectedAction = "tns:actiontest/action/echoOut"; + PortType pt = definition + .getPortType(new QName("http://ws.apache.org/axis2/actiontest/", "withWSAWActionURI")); + List operations = pt.getOperations(); + Operation op = (Operation) operations.get(0); + Output out = op.getOutput(); + String actualAction = + WSDL11ActionHelper.getActionFromOutputElement(definition, pt, op, out); + assertEquals(expectedAction, actualAction); + } + + public void testGetWSAWFaultActionURI() { + String expectedAction = "tns:actiontest/action/echoFault"; + PortType pt = definition + .getPortType(new QName("http://ws.apache.org/axis2/actiontest/", "withWSAWActionURI")); + List operations = pt.getOperations(); + Operation op = (Operation) operations.get(0); + Fault fault = op.getFault("echoFault"); + String actualAction = + WSDL11ActionHelper.getActionFromFaultElement(definition, pt, op, fault); + assertEquals(expectedAction, actualAction); + } + + // Test reading wsaw:Action values + // portType=withWSAActionURI + // operation=echo + public void testGetWSAInputAction() { + String expectedAction = "tns:actiontest/action/echoIn"; + PortType pt = definition + .getPortType(new QName("http://ws.apache.org/axis2/actiontest/", "withWSAActionURI")); + List operations = pt.getOperations(); + Operation op = (Operation) operations.get(0); + Input in = op.getInput(); + String actualAction = WSDL11ActionHelper.getActionFromInputElement(definition, pt, op, in); + assertEquals(expectedAction, actualAction); + } + + public void testGetWSAOutputAction() { + String expectedAction = "tns:actiontest/action/echoOut"; + PortType pt = definition + .getPortType(new QName("http://ws.apache.org/axis2/actiontest/", "withWSAActionURI")); + List operations = pt.getOperations(); + Operation op = (Operation) operations.get(0); + Output out = op.getOutput(); + String actualAction = + WSDL11ActionHelper.getActionFromOutputElement(definition, pt, op, out); + assertEquals(expectedAction, actualAction); + } + + public void testGetWSAFaultAction() { + String expectedAction = "tns:actiontest/action/echoFault"; + PortType pt = definition + .getPortType(new QName("http://ws.apache.org/axis2/actiontest/", "withWSAActionURI")); + List operations = pt.getOperations(); + Operation op = (Operation) operations.get(0); + Fault fault = op.getFault("echoFault"); + String actualAction = + WSDL11ActionHelper.getActionFromFaultElement(definition, pt, op, fault); + assertEquals(expectedAction, actualAction); + } + + // Test reading wsaw:Action values + // portType=withWSAMActionURI + // operation=echo + public void testGetWSAMInputAction() { + String expectedAction = "tns:actiontest/action/echoIn"; + PortType pt = definition + .getPortType(new QName("http://ws.apache.org/axis2/actiontest/", "withWSAMActionURI")); + List operations = pt.getOperations(); + Operation op = (Operation) operations.get(0); + Input in = op.getInput(); + String actualAction = WSDL11ActionHelper.getActionFromInputElement(definition, pt, op, in); + assertEquals(expectedAction, actualAction); + } + + public void testGetWSAMOutputAction() { + String expectedAction = "tns:actiontest/action/echoOut"; + PortType pt = definition + .getPortType(new QName("http://ws.apache.org/axis2/actiontest/", "withWSAMActionURI")); + List operations = pt.getOperations(); + Operation op = (Operation) operations.get(0); + Output out = op.getOutput(); + String actualAction = + WSDL11ActionHelper.getActionFromOutputElement(definition, pt, op, out); + assertEquals(expectedAction, actualAction); + } + + public void testGetWSAMFaultAction() { + String expectedAction = "tns:actiontest/action/echoFault"; + PortType pt = definition + .getPortType(new QName("http://ws.apache.org/axis2/actiontest/", "withWSAMActionURI")); + List operations = pt.getOperations(); + Operation op = (Operation) operations.get(0); + Fault fault = op.getFault("echoFault"); + String actualAction = + WSDL11ActionHelper.getActionFromFaultElement(definition, pt, op, fault); + assertEquals(expectedAction, actualAction); + } + + // Test reading wsaw:Action values + // portType=withWSASubmissionActionURI + // operation=echo + public void testGetWSAWSubmissionInputAction() { + String expectedAction = "tns:actiontest/action/echoIn"; + PortType pt = definition + .getPortType(new QName("http://ws.apache.org/axis2/actiontest/", "withWSASubmissionActionURI")); + List operations = pt.getOperations(); + Operation op = (Operation) operations.get(0); + Input in = op.getInput(); + String actualAction = WSDL11ActionHelper.getActionFromInputElement(definition, pt, op, in); + assertEquals(expectedAction, actualAction); + } + + public void testGetWSAWSubmissionOutputAction() { + String expectedAction = "tns:actiontest/action/echoOut"; + PortType pt = definition + .getPortType(new QName("http://ws.apache.org/axis2/actiontest/", "withWSASubmissionActionURI")); + List operations = pt.getOperations(); + Operation op = (Operation) operations.get(0); + Output out = op.getOutput(); + String actualAction = + WSDL11ActionHelper.getActionFromOutputElement(definition, pt, op, out); + assertEquals(expectedAction, actualAction); + } + + public void testGetWSAWSubmissionFaultAction() { + String expectedAction = "tns:actiontest/action/echoFault"; + PortType pt = definition + .getPortType(new QName("http://ws.apache.org/axis2/actiontest/", "withWSASubmissionActionURI")); + List operations = pt.getOperations(); + Operation op = (Operation) operations.get(0); + Fault fault = op.getFault("echoFault"); String actualAction = WSDL11ActionHelper.getActionFromFaultElement(definition, pt, op, fault); assertEquals(expectedAction, actualAction); Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/builder/SOAPBuilderTest.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/builder/SOAPBuilderTest.java?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/builder/SOAPBuilderTest.java (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/builder/SOAPBuilderTest.java Sun Dec 17 22:34:08 2017 @@ -37,8 +37,7 @@ public class SOAPBuilderTest extends Abs } /** - * Simple test the makes sure SOAPBuilder builds a document and - * has a content length + * Simple test the makes sure SOAPBuilder builds a document * @throws Exception */ public void test() throws Exception { @@ -49,6 +48,5 @@ public class SOAPBuilderTest extends Abs OMElement envelope = soapBuilder.processDocument(fis, "text/xml", mc); assertTrue(envelope != null); assertTrue(envelope instanceof SOAPEnvelope); - assertTrue(mc.getInboundContentLength() > 2000); } } Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/client/ServiceClientTest.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/client/ServiceClientTest.java?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/client/ServiceClientTest.java (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/client/ServiceClientTest.java Sun Dec 17 22:34:08 2017 @@ -45,7 +45,7 @@ public class ServiceClientTest extends A if (basedir == null) { basedir = "."; } - URL zipUrl = new File(basedir, "target/test-zip.zip").toURL(); + URL zipUrl = new File(basedir, "target/test-zip.zip").toURI().toURL(); URL wsdlUrl = new URL("jar:" + zipUrl + "!/test.wsdl"); ServiceClient serviceClient = new ServiceClient(configContext, wsdlUrl, new QName("urn:test", "EchoService"), "EchoPort"); List<XmlSchema> schemas = serviceClient.getAxisService().getSchema(); Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/dataretrieval/SchemaDataLocatorTest.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/dataretrieval/SchemaDataLocatorTest.java?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/dataretrieval/SchemaDataLocatorTest.java (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/dataretrieval/SchemaDataLocatorTest.java Sun Dec 17 22:34:08 2017 @@ -76,7 +76,7 @@ public class SchemaDataLocatorTest exten + "SchemaDataLocatorTest.xml"); assertNotNull(data); assertEquals(data.length, 1); - assertSimilarXML(s, expected); + assertSimilarXML(expected, s); } Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/deployment/DeploymentTotalTest.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/deployment/DeploymentTotalTest.java?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/deployment/DeploymentTotalTest.java (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/deployment/DeploymentTotalTest.java Sun Dec 17 22:34:08 2017 @@ -19,39 +19,46 @@ package org.apache.axis2.deployment; -import junit.framework.TestCase; -import org.apache.axis2.AbstractTestCase; +import org.apache.axis2.Axis2Repo; import org.apache.axis2.AxisFault; -import org.apache.axis2.context.ConfigurationContextFactory; import org.apache.axis2.description.Parameter; import org.apache.axis2.engine.AxisConfiguration; import org.apache.axis2.engine.Handler; import org.apache.axis2.engine.Phase; import org.apache.axis2.registry.Handler3; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; import javax.xml.stream.XMLStreamException; -import java.util.ArrayList; -import java.util.List; -public class DeploymentTotalTest extends TestCase { - AxisConfiguration axisConfig; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.List; - protected void setUp() throws Exception { - String filename = AbstractTestCase.basedir + "/target/test-resources/deployment"; - axisConfig = ConfigurationContextFactory - .createConfigurationContextFromFileSystem(filename, filename + "/axis2.xml") - .getAxisConfiguration(); - axisConfig.engageModule("module1"); +public class DeploymentTotalTest { + @Rule + public Axis2Repo repo = new Axis2Repo("target/test-resources/deployment"); + + @Before + public void setUp() throws Exception { + repo.getAxisConfiguration().engageModule("module1"); // OK, no exceptions. Now make sure we read the correct file... } + @Test public void testparseService1() throws AxisFault, XMLStreamException { - Parameter param = axisConfig.getParameter("FavoriteColor"); + Parameter param = repo.getAxisConfiguration().getParameter("FavoriteColor"); assertNotNull("No FavoriteColor parameter in axis2.xml!", param); assertEquals("purple", param.getValue()); } + @Test public void testDynamicPhase() { + AxisConfiguration axisConfig = repo.getAxisConfiguration(); + List inFlow = axisConfig.getInFlowPhases(); for (int i = 0; i < inFlow.size(); i++) { Phase phase = (Phase) inFlow.get(i); Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/AxisService2WSDLTest.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/AxisService2WSDLTest.java?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/AxisService2WSDLTest.java (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/AxisService2WSDLTest.java Sun Dec 17 22:34:08 2017 @@ -59,8 +59,8 @@ public class AxisService2WSDLTest extend // + "testGenerateInterfaceOperationElement_WSDL.wsdl", // element.toString()); XMLPrettyPrinter.prettify(element, stream); - assertSimilarXML(stream.toString(), readWSDLFromFile("test-resources" + File.separator - + "wsdl" + File.separator + "testGenerateInterfaceOperationElement_WSDL.wsdl")); + assertSimilarXML(readWSDLFromFile("test-resources" + File.separator + + "wsdl" + File.separator + "testGenerateInterfaceOperationElement_WSDL.wsdl"), stream.toString()); } @@ -75,8 +75,8 @@ public class AxisService2WSDLTest extend // + // "testGenerateInterfaceOperationElement11_WSDL.wsdl",element.toString()); XMLPrettyPrinter.prettify(element, stream); - assertSimilarXML(stream.toString(), readWSDLFromFile("test-resources" + File.separator - + "wsdl" + File.separator + "testGenerateInterfaceOperationElement11_WSDL.wsdl")); + assertSimilarXML(readWSDLFromFile("test-resources" + File.separator + + "wsdl" + File.separator + "testGenerateInterfaceOperationElement11_WSDL.wsdl"), stream.toString()); } Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/AxisServiceTest.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/AxisServiceTest.java?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/AxisServiceTest.java (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/AxisServiceTest.java Sun Dec 17 22:34:08 2017 @@ -263,8 +263,8 @@ public class AxisServiceTest extends XML service.printXSD(stream, ""); // service has a single schema and it is printed. The it is compared // with the saved file - assertSimilarXML(stream.toString(), readXMLfromSchemaFile(SampleSchemasDirectory - + "printXSDReference.xsd")); + assertSimilarXML(readXMLfromSchemaFile(SampleSchemasDirectory + + "printXSDReference.xsd"), stream.toString()); } public void testPrintWSDL() throws Exception { @@ -274,7 +274,7 @@ public class AxisServiceTest extends XML String s = readWSDLFromFile("test-resources" + File.separator + "wsdl" + File.separator + "printWSDLreference.wsdl"); - assertSimilarXML(stream.toString(), s); + assertSimilarXML(s, stream.toString()); } public String convertXMLFileToString(String fileName) { Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/WSDL11ToAxisServiceBuilderTest.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/WSDL11ToAxisServiceBuilderTest.java?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/WSDL11ToAxisServiceBuilderTest.java (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/WSDL11ToAxisServiceBuilderTest.java Sun Dec 17 22:34:08 2017 @@ -18,18 +18,26 @@ */ package org.apache.axis2.description; +import java.io.File; import java.io.FileInputStream; +import java.io.IOException; import java.io.InputStream; -import java.util.List; import java.util.ArrayList; -import java.util.Set; +import java.util.HashMap; import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.wsdl.xml.WSDLLocator; import javax.xml.namespace.QName; +import org.apache.axis2.engine.AxisConfiguration; +import org.apache.axis2.wsdl.WSDLConstants; import org.apache.ws.commons.schema.XmlSchema; import org.apache.ws.commons.schema.XmlSchemaElement; import org.apache.ws.commons.schema.XmlSchemaObject; +import org.xml.sax.InputSource; import junit.framework.TestCase; @@ -100,4 +108,223 @@ public class WSDL11ToAxisServiceBuilderT return duplicatedGlobalElementDeclarations; } + private AxisService populateAxisService(AxisConfiguration axisConf, File wsdlFile) throws IOException { + InputStream in = null; + try { + in = new FileInputStream(wsdlFile); + WSDL11ToAxisServiceBuilder wsdl11Builder = new WSDL11ToAxisServiceBuilder(in); + if (axisConf != null) { + wsdl11Builder.useAxisConfiguration(axisConf); + } + AxisService service = wsdl11Builder.populateService(); + assertNotNull("Could not load AxisService from wsdl: " + wsdlFile.getAbsolutePath(), service); + + return service; + } finally { + if (in != null) { + in.close(); + } + } + } + + private void checkOperationActions(AxisService service, AxisOperation operation, String expectedInputAction, String expectedOutputAction, String expectedFaultAction) { + assertEquals(String.format("Expected that operation '%s' of service '%s' defines an input action of '%s' but it defines '%s' instead.", operation.getName(), service.getName(), expectedInputAction, operation.getInputAction()), expectedInputAction, operation.getInputAction()); + assertEquals(String.format("Expected that operation '%s' of service '%s' defines an output action of '%s' but it defines '%s' instead.", operation.getName(), service.getName(), expectedOutputAction, operation.getOutputAction()), expectedOutputAction, operation.getOutputAction()); + assertEquals(String.format("Expected that operation '%s' of service '%s' defines an input action of '%s' but it defines '%s' instead.", operation.getName(), service.getName(), expectedFaultAction, operation.getFaultAction()), expectedFaultAction, operation.getFaultAction()); + + ArrayList<String> wsaMappingList = operation.getWSAMappingList(); + assertEquals(String.format("Expected that operation '%s' of service '%s' has a 'wsaMappingList' of size '%d' but size is '%d' instead.", operation.getName(), service.getName(), 1, wsaMappingList.size()), 1, wsaMappingList.size()); + assertTrue(String.format("Expected that the 'wsaMappingList' of operation '%s' of service '%s' contains an entry of '%s' but it does not.", operation.getName(), service.getName(), expectedInputAction), wsaMappingList.contains(expectedInputAction)); + + assertSame(String.format("Expected that 'operationsAliasesMap' of service '%s' contains a '%s' operation for action '%s'.", service.getName(), operation.getName(), expectedInputAction), service.getOperationByAction(expectedInputAction), operation); + } + + public void testGetVersionActions() throws IOException { + AxisConfiguration axisConf = new AxisConfiguration(); + AxisService service = populateAxisService(axisConf, new File("test-resources/wsdl/Version.wsdl")); + + String[] operationNames = new String[] { + "getVersionWSAW", "getVersionWSA", "getVersionWSAM", "getVersionWSAWSubmission", + "getVersionWSAWURI", "getVersionWSAURI", "getVersionWSAMURI", "getVersionWSAWSubmissionURI" + }; + + for (String operationName : operationNames) { + QName operationQName = new QName("http://axisversion.sample", operationName); + AxisOperation operation = service.getOperation(operationQName); + assertNotNull(String.format("Could not find AxisOperation '%s' in service: %s", operationQName.toString(), service.getName()), operation); + + String prefix = operationName.endsWith("URI") ? "ns:Version" : "http://axisversion.sample"; + String expectedInputAction = String.format("%s/VersionPortType/%sRequest", prefix, operationQName.getLocalPart()); + String expectedOutputAction = String.format("%s/VersionPortType/%sResponse", prefix, operationQName.getLocalPart()); + String expectedFaultAction = String.format("%s/VersionPortType/Fault/%sException", prefix, operationQName.getLocalPart()); + + checkOperationActions(service, operation, expectedInputAction,expectedOutputAction,expectedFaultAction); + } + } + + /** + * Tests parsing of <code>EchoService.wsdl</code> into an AxisService instance. The <code>EchoService.wsdl</code> + * imports <code>EchoBindings.wsdl</code>, which contains the binding definitions (note that it does not reverse-import the EchoService.wsdl). + * Parsing the wsdl should cause neither a "There is no port type associated with the binding" exception, nor a "Cannot determine the MEP" exception, + * provided that Axis2 does not recursively search the port type in all imported wsdls, but looks it up via {@link javax.wsdl.Definition#getPortType(QName)}, + * falling back to {@link javax.wsdl.Binding#getPortType()} if not available (will be the case when port type is imported through another document but not directly) + * + * The test verifies that no exceptions are thrown and additionally checks that the endpoint, binding, operation and its in/out messages are correctly populated from the WSDL definition. + * @throws IOException + */ + public void testImportedBindings() throws IOException { + AxisConfiguration axisConf = new AxisConfiguration(); + WSDLLocator wsdlLocator = new CustomWSDLLocator("test-resources/wsdl/imports/binding/", "EchoService.wsdl"); + AxisService service = populateAxisService(axisConf, new File(wsdlLocator.getBaseURI()), wsdlLocator); + assertValidEchoService(service, wsdlLocator); + } + + /** + * Tests parsing of <code>EchoService.wsdl</code> into an AxisService instance. The <code>EchoService.wsdl</code> + * imports <code>EchoBindings.wsdl</code>, which reverse-imports the EchoService.wsdl (i.e. we have a circular import). + * Parsing the wsdl should cause neither a "There is no port type associated with the binding" exception, nor a "Cannot determine the MEP" exception, + * provided that Axis2 does not recursively search the port type in all imported wsdls, but looks it up via {@link javax.wsdl.Definition#getPortType(QName)}, + * falling back to {@link javax.wsdl.Binding#getPortType()} if not available (will be the case when port type is imported through another document but not directly) + * + * The test verifies that no exceptions are thrown and additionally checks that the endpoint, binding, operation and its in/out messages are correctly populated from the WSDL definition. + * @throws IOException + */ + public void testCircularImportedBindings() throws IOException { + AxisConfiguration axisConf = new AxisConfiguration(); + WSDLLocator wsdlLocator = new CustomWSDLLocator("test-resources/wsdl/imports/binding_recursive/", "EchoService.wsdl"); + AxisService service = populateAxisService(axisConf, new File(wsdlLocator.getBaseURI()), wsdlLocator); + assertValidEchoService(service, wsdlLocator); + } + + /** + * Tests parsing of <code>EchoService.wsdl</code> into an AxisService instance. The <code>EchoService.wsdl</code> + * imports <code>EchoBindings.wsdl</code>, which in turn imports the <code>EchoPortType.wsdl</code>. + * Parsing the wsdl should cause neither a "There is no port type associated with the binding" exception, nor a "Cannot determine the MEP" exception, + * provided that Axis2 does not recursively search the port type in all imported wsdls, but looks it up via {@link javax.wsdl.Definition#getPortType(QName)}, + * falling back to {@link javax.wsdl.Binding#getPortType()} if not available (will be the case when port type is imported through another document but not directly) + * + * The test verifies that no exceptions are thrown and additionally checks that the endpoint, binding, operation and its in/out messages are correctly populated from the WSDL definition. + * @throws IOException + */ + public void testImportedPortType() throws IOException { + AxisConfiguration axisConf = new AxisConfiguration(); + WSDLLocator wsdlLocator = new CustomWSDLLocator("test-resources/wsdl/imports/portType/", "EchoService.wsdl"); + AxisService service = populateAxisService(axisConf, new File(wsdlLocator.getBaseURI()), wsdlLocator); + assertValidEchoService(service, wsdlLocator); + } + + private void assertValidEchoService(AxisService echoService, WSDLLocator wsdlLocator) { + //check soap12 endpoint and binding are available + String endpointName = "EchoServiceHttpSoap12Endpoint"; + AxisEndpoint soap12Endpoint = echoService.getEndpoint(endpointName); + assertNotNull(String.format("Cannot find %s endpoint in wsdl definition: %s", endpointName, wsdlLocator.getBaseURI()), soap12Endpoint); + + AxisBinding soap12Binding = soap12Endpoint.getBinding(); + assertNotNull(String.format("Binding not set on %s endpoint in wsdl definition: %s", endpointName, wsdlLocator.getBaseURI()), soap12Binding); + + //check that policy reference is present on the binding subject + String bindingPolicyRefId = "#basicAuthPolicy"; + assertNotNull(String.format("Cannot find policy reference %s on binding %s", bindingPolicyRefId, soap12Binding.getName()), + soap12Binding.getPolicySubject().getAttachedPolicyComponent(bindingPolicyRefId)); + + //check that binding operation and respective operation are available + QName echoBindingOpName = new QName("http://tempuri.org/bindings", "echo"); + AxisBindingOperation echoBindingOp = (AxisBindingOperation) soap12Binding.getChild(echoBindingOpName); + assertNotNull(String.format("Cannot find %s binding operation on binding %s", echoBindingOpName, soap12Binding), echoBindingOp); + + AxisOperation echoOp = echoBindingOp.getAxisOperation(); + assertNotNull(String.format("Operation not set on binding operation %s", echoBindingOp.getName()), echoOp); + + //check that operation style is correctly identified and an operation with respective mep is created + assertTrue(String.format("Operation %s is not an instance of %s", echoOp.getName(), InOutAxisOperation.class.getName()), echoOp instanceof InOutAxisOperation); + assertEquals(String.format("Operation %s specifies an unexpected MEP uri: %s", echoOp.getName(), echoOp.getMessageExchangePattern()), + WSDL2Constants.MEP_URI_IN_OUT, echoOp.getMessageExchangePattern()); + + //check in/out messages + AxisMessage inMessage = echoOp.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE); + assertNotNull(String.format("No input message set on operation %s", echoOp.getName()), inMessage); + QName echoInMessageName = new QName("http://tempuri.org/types", "echo"); + assertEquals(String.format("Unexpected input message QName set on operation %s", echoOp.getName()), echoInMessageName, inMessage.getElementQName()); + //message name is 'echoRequest' whereas the QName's local name is simply 'echo' + assertEquals(String.format("Unexpected input message name set on operation %s", echoOp.getName()), "echoRequest", inMessage.getName()); + + AxisMessage outMessage = echoOp.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE); + assertNotNull(String.format("No output message set on operation %s", echoOp.getName()), outMessage); + QName echoOutMessageName = new QName("http://tempuri.org/types", "echoResponse"); + assertEquals(String.format("Unexpected output message QName set on operation %s", echoOp.getName()), echoOutMessageName, outMessage.getElementQName()); + assertEquals(String.format("Unexpected output message name set on operation %s", echoOp.getName()), echoOutMessageName.getLocalPart(), outMessage.getName()); + } + + private AxisService populateAxisService(AxisConfiguration axisConf, File wsdlFile, WSDLLocator wsdlLocator) throws IOException { + InputStream in = null; + try { + in = new FileInputStream(wsdlFile); + WSDL11ToAxisServiceBuilder wsdl11Builder = new WSDL11ToAxisServiceBuilder(in); + if (wsdlLocator != null) { + wsdl11Builder.setCustomWSDLResolver(wsdlLocator); + } + wsdl11Builder.setDocumentBaseUri(wsdlFile.getParentFile().toURI().toString()); + if (axisConf != null) { + wsdl11Builder.useAxisConfiguration(axisConf); + } + AxisService service = wsdl11Builder.populateService(); + assertNotNull("Could not load AxisService from wsdl: " + wsdlFile.getAbsolutePath(), service); + + return service; + } finally { + if (in != null) { + in.close(); + } + } + } + + //custom locator that can located imported wsdls relative to the base wsdl uri (code borrowed from wsdl4j) + class CustomWSDLLocator implements WSDLLocator { + private String wsdlURI; + + private InputSource baseInputSource; + private Map<String, InputSource> importInputSources = new HashMap<String, InputSource>(); + private boolean closed = false; + private String baseURI; + private String lastImportURI; + + public CustomWSDLLocator(String baseURI, String wsdlURI) { + this.baseURI = baseURI; + this.wsdlURI = wsdlURI; + } + + public InputSource getBaseInputSource() { + if (baseInputSource == null) { + lastImportURI = baseURI + wsdlURI; + baseInputSource = new InputSource(lastImportURI); + } + return baseInputSource; + } + + public InputSource getImportInputSource(String parentLocation, String importLocation) { + InputSource inSource = (InputSource) importInputSources.get(importLocation); + if (inSource == null) { + lastImportURI = baseURI + importLocation; + inSource = new InputSource(lastImportURI); + importInputSources.put(importLocation, inSource); + } + return inSource; + } + + public String getBaseURI() { + return baseURI + wsdlURI; + } + + public String getLatestImportURI() { + return lastImportURI; + } + + public void close() { + closed = true; + } + + public boolean isClosed() { + return closed; + } + } } Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/WSDLWrapperTest.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/WSDLWrapperTest.java?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/WSDLWrapperTest.java (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/WSDLWrapperTest.java Sun Dec 17 22:34:08 2017 @@ -20,23 +20,23 @@ package org.apache.axis2.description; import junit.framework.TestCase; -import org.apache.axis2.AbstractTestCase; -import org.apache.axis2.context.ConfigurationContextFactory; -import org.apache.axis2.engine.AxisConfiguration; -import org.apache.axis2.wsdl.util.WSDLDefinitionWrapper; -import org.w3c.dom.Document; -import org.xml.sax.ErrorHandler; +import org.apache.axis2.AbstractTestCase; +import org.apache.axis2.context.ConfigurationContextFactory; +import org.apache.axis2.engine.AxisConfiguration; +import org.apache.axis2.wsdl.WSDLUtil; +import org.apache.axis2.wsdl.util.WSDLDefinitionWrapper; +import org.w3c.dom.Document; +import org.xml.sax.ErrorHandler; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; -import javax.wsdl.Definition; -import javax.wsdl.Types; -import javax.wsdl.WSDLException; -import javax.wsdl.factory.WSDLFactory; -import javax.wsdl.xml.WSDLLocator; -import javax.wsdl.xml.WSDLReader; -import javax.xml.namespace.QName; +import javax.wsdl.Definition; +import javax.wsdl.Types; +import javax.wsdl.WSDLException; +import javax.wsdl.xml.WSDLLocator; +import javax.wsdl.xml.WSDLReader; +import javax.xml.namespace.QName; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; @@ -115,7 +115,7 @@ public class WSDLWrapperTest extends Tes .createConfigurationContextFromFileSystem(null, axis2xml) .getAxisConfiguration(); - WSDLDefinitionWrapper passthru = new WSDLDefinitionWrapper(def1, testResourceFile1.toURL(), false); + WSDLDefinitionWrapper passthru = new WSDLDefinitionWrapper(def1, testResourceFile1.toURI().toURL(), false); Definition def_passthru = passthru.getUnwrappedDefinition(); String def_passthru_str = def_passthru.toString(); @@ -123,7 +123,7 @@ public class WSDLWrapperTest extends Tes String def_passthru_namespace = def_passthru.getTargetNamespace(); Types def_passthru_types = def_passthru.getTypes(); - WSDLDefinitionWrapper serialize = new WSDLDefinitionWrapper(def1, testResourceFile1.toURL(), axisCfg); + WSDLDefinitionWrapper serialize = new WSDLDefinitionWrapper(def1, testResourceFile1.toURI().toURL(), axisCfg); Definition def_serialize = serialize.getUnwrappedDefinition(); String def_serialize_str = def_serialize.toString(); @@ -131,7 +131,7 @@ public class WSDLWrapperTest extends Tes String def_serialize_namespace = def_serialize.getTargetNamespace(); Types def_serialize_types = def_serialize.getTypes(); - WSDLDefinitionWrapper reload = new WSDLDefinitionWrapper(def1, testResourceFile1.toURL(), 2); + WSDLDefinitionWrapper reload = new WSDLDefinitionWrapper(def1, testResourceFile1.toURI().toURL(), 2); Definition def_reload = reload.getUnwrappedDefinition(); String def_reload_str = def_reload.toString(); @@ -145,13 +145,13 @@ public class WSDLWrapperTest extends Tes } } - - private Definition readInTheWSDLFile(InputStream in) throws WSDLException { - - WSDLReader reader = WSDLFactory.newInstance().newWSDLReader(); - - // switch off the verbose mode for all usecases - reader.setFeature(JAVAX_WSDL_VERBOSE_MODE_KEY, false); + + private Definition readInTheWSDLFile(InputStream in) throws WSDLException { + + WSDLReader reader = WSDLUtil.newWSDLReaderWithPopulatedExtensionRegistry(); + + // switch off the verbose mode for all usecases + reader.setFeature(JAVAX_WSDL_VERBOSE_MODE_KEY, false); // if the custem resolver is present then use it if (customWSLD4JResolver != null) { Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/java2wsdl/DefaultSchemaGeneratorTest.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/java2wsdl/DefaultSchemaGeneratorTest.java?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/java2wsdl/DefaultSchemaGeneratorTest.java (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/java2wsdl/DefaultSchemaGeneratorTest.java Sun Dec 17 22:34:08 2017 @@ -112,8 +112,7 @@ public class DefaultSchemaGeneratorTest String XML1 = byteArrayOutputStream.toString(); String XML2 = readSchema(c, i); - assertSimilarXML(XML1, XML2); - assertIdenticalXML(XML1, XML2); + assertSimilarXML(XML2, XML1); } } @@ -131,8 +130,7 @@ public class DefaultSchemaGeneratorTest xmlSchema.write(byteArrayOutputStream); String XML1 = byteArrayOutputStream.toString(); String XML2 = readSchemaWithCustomSchema(c, i); - assertSimilarXML(XML1, XML2); - assertIdenticalXML(XML1, XML2); + assertSimilarXML(XML2, XML1); } } @@ -151,8 +149,7 @@ public class DefaultSchemaGeneratorTest String XML1 = byteArrayOutputStream.toString(); String XML2 = readSchemaWithMappingSchema(c, i); XML1 = prepareForMapping(XML1); - assertSimilarXML(XML1, XML2); - assertIdenticalXML(XML1, XML2); + assertSimilarXML(XML2, XML1); } } @@ -224,8 +221,7 @@ public class DefaultSchemaGeneratorTest String XML1 = byteArrayOutputStream.toString(); XML1 = prepareForDOM(XML1); String XML2 = readSchema(c, i); - assertSimilarXML(XML1, XML2); - assertIdenticalXML(XML1, XML2); + assertSimilarXML(XML2, XML1); } } @@ -262,8 +258,7 @@ public class DefaultSchemaGeneratorTest XML1 = prepareForMap(XML1); } String XML2 = readSchema(c, i); - assertSimilarXML(XML1, XML2); - assertIdenticalXML(XML1, XML2); + assertSimilarXML(XML2, XML1); } } @@ -315,8 +310,7 @@ public class DefaultSchemaGeneratorTest XML1 = prepareForPOJO(XML1); } String XML2 = readSchema(c, i); - assertSimilarXML(XML1, XML2); - assertIdenticalXML(XML1, XML2); + assertSimilarXML(XML2, XML1); } } @@ -358,8 +352,7 @@ public class DefaultSchemaGeneratorTest XML1 = prepareForExc(XML1); } String XML2 = readSchema(c, i); - assertSimilarXML(XML1, XML2); - assertIdenticalXML(XML1, XML2); + assertSimilarXML(XML2, XML1); } } @@ -404,8 +397,7 @@ public class DefaultSchemaGeneratorTest } XML1 = prepareForEnum(XML1); String XML2 = readSchema(c, i); - assertSimilarXML(XML1, XML2); - assertIdenticalXML(XML1, XML2); + assertSimilarXML(XML2, XML1); } } Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/java2wsdl/XMLSchemaTest.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/java2wsdl/XMLSchemaTest.java?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/java2wsdl/XMLSchemaTest.java (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/java2wsdl/XMLSchemaTest.java Sun Dec 17 22:34:08 2017 @@ -20,12 +20,15 @@ package org.apache.axis2.description.java2wsdl; import junit.framework.TestCase; + import org.apache.axis2.util.XMLPrettyPrinter; import org.apache.ws.commons.schema.XmlSchema; import org.apache.ws.commons.schema.XmlSchemaCollection; import org.custommonkey.xmlunit.Diff; +import org.custommonkey.xmlunit.XMLUnit; import javax.xml.transform.stream.StreamSource; + import java.io.BufferedReader; import java.io.ByteArrayOutputStream; import java.io.File; @@ -55,16 +58,15 @@ public abstract class XMLSchemaTest exte + "schemas" + File.separator + "mapping_files" + File.separator + "mapping1.txt"; - public void assertSimilarXML(String XML1, String XML2) throws Exception { - Diff myDiff = new Diff(XML1, XML2); - assertTrue("XML similar " + myDiff.toString(), myDiff.similar()); - - } - - public void assertIdenticalXML(String XML1, String XML2) throws Exception { - Diff myDiff = new Diff(XML1, XML2); - assertTrue("XML similar " + myDiff.toString(), myDiff.identical()); - + public void assertSimilarXML(String expected, String actual) throws Exception { + boolean ignoreWhitespace = XMLUnit.getIgnoreWhitespace(); + XMLUnit.setIgnoreWhitespace(true); + try { + Diff myDiff = new Diff(expected, actual); + assertTrue("XML similar " + myDiff.toString(), myDiff.similar()); + } finally { + XMLUnit.setIgnoreWhitespace(ignoreWhitespace); + } } public void loadSampleSchemaFile(ArrayList<XmlSchema> schemas) throws Exception{ @@ -120,8 +122,9 @@ public abstract class XMLSchemaTest exte public String readWSDLFromFile(String path) throws Exception { - File file=new File(path); - XMLPrettyPrinter.prettify(file); //this is used to correct unnecessary formatting in the file + // Don't do this; it will overwrite a file in the source tree (see AXIS2-5781). +// File file=new File(path); +// XMLPrettyPrinter.prettify(file); //this is used to correct unnecessary formatting in the file return readFile(path); } Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/util/MessageContextBuilderTest.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/util/MessageContextBuilderTest.java?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/util/MessageContextBuilderTest.java (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/util/MessageContextBuilderTest.java Sun Dec 17 22:34:08 2017 @@ -76,7 +76,7 @@ public class MessageContextBuilderTest e SOAPFault fault = faultContext.getEnvelope().getBody().getFault(); String se = faultContext.getEnvelope().getNamespace().getPrefix(); - assertEquals (fault.getCode().getTextAsQName().getPrefix(), se); + assertEquals (fault.getCode().getValueAsQName().getPrefix(), se); } Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/validation/ValidateAxis2XMLTest.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/validation/ValidateAxis2XMLTest.java?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/validation/ValidateAxis2XMLTest.java (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/validation/ValidateAxis2XMLTest.java Sun Dec 17 22:34:08 2017 @@ -54,7 +54,7 @@ public class ValidateAxis2XMLTest extend SAXParser parser = factory.newSAXParser(); //validate against the given schemaURL - parser.setProperty(extSchemaProp, xsdSource.toURL().toString()); + parser.setProperty(extSchemaProp, xsdSource.toURI().toURL().toString()); // parse (validates) the xml parser.parse(xmlSource, new DefaultHandler()); Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/metadata/pom.xml URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/metadata/pom.xml?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/metadata/pom.xml (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/metadata/pom.xml Sun Dec 17 22:34:08 2017 @@ -23,9 +23,9 @@ <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.apache.axis2</groupId> - <artifactId>axis2-parent</artifactId> - <version>1.7.0-SNAPSHOT</version> - <relativePath>../parent/pom.xml</relativePath> + <artifactId>axis2</artifactId> + <version>1.8.0-SNAPSHOT</version> + <relativePath>../../pom.xml</relativePath> </parent> <artifactId>axis2-metadata</artifactId> <name>Apache Axis2 - Metadata</name> @@ -66,10 +66,6 @@ </exclusions> </dependency> <dependency> - <groupId>com.sun.xml.bind</groupId> - <artifactId>jaxb-xjc</artifactId> - </dependency> - <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <scope>test</scope> @@ -158,24 +154,23 @@ </executions> </plugin> <plugin> - <artifactId>maven-dependency-plugin</artifactId> + <groupId>com.github.veithen.alta</groupId> + <artifactId>alta-maven-plugin</artifactId> <executions> <execution> - <phase>generate-resources</phase> <goals> - <goal>copy</goal> + <goal>generate-properties</goal> </goals> <configuration> - <artifactItems> - <artifactItem> + <artifacts> + <artifact> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-jaxws_2.2_spec</artifactId> - <type>jar</type> - </artifactItem> - </artifactItems> - <overWrite>true</overWrite> - <outputDirectory>${project.build.directory}/endorsed</outputDirectory> - <stripVersion>true</stripVersion> + </artifact> + </artifacts> + <name>jaxws.bootclasspath</name> + <value>%file%</value> + <separator>${path.separator}</separator> </configuration> </execution> </executions> @@ -185,11 +180,8 @@ <inherited>true</inherited> <configuration> <compilerArgument> - -Xbootclasspath/p:${project.build.directory}/endorsed/geronimo-jaxws_2.2_spec.jar + -Xbootclasspath/p:${jaxws.bootclasspath} </compilerArgument> - <compilerVersion>1.5</compilerVersion> - <source>1.5</source> - <target>1.5</target> </configuration> </plugin> <plugin> @@ -209,38 +201,38 @@ </executions> </plugin> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-antrun-plugin</artifactId> + <groupId>org.codehaus.mojo</groupId> + <artifactId>jaxb2-maven-plugin</artifactId> <executions> <execution> - <id>gen-ts</id> - <phase>generate-test-sources</phase> - <configuration> - <tasks unless="maven.test.skip"> - <!-- Theres got to be a better way to do this --> - <property name="schema.source.dir" value="test-resources/xsd" /> - <property name="wsdl.source.dir" value="test-resources/wsdl" /> - <property name="schema.output.base.dir" value="target/schema" /> - <property name="schema.generated.src.dir" value="${schema.output.base.dir}/src" /> - <property name="schema.generated.classes.dir" value="${schema.output.base.dir}/classes" /> - <!-- make the dirs --> - <mkdir dir="${schema.output.base.dir}" /> - <mkdir dir="${schema.generated.src.dir}" /> - <mkdir dir="${schema.generated.classes.dir}" /> - <!-- Run JAXB schema compiler with designated schemas --> - <echo>Generating JAX-B classes from XSDs</echo> - <echo>Generating java from ProxyDocLitWrapped.wsdl</echo> - <java classname="com.sun.tools.xjc.Driver" fork="true"> - <classpath refid="maven.runtime.classpath" /> - <classpath location="${compiled.classes.dir}" /> - <arg line="-d ${schema.generated.src.dir} -quiet -p org.test.proxy.doclitwrapped -quiet -wsdl ${wsdl.source.dir}/ProxyDocLitWrapped.wsdl" /> - </java> - </tasks> - </configuration> <goals> - <goal>run</goal> + <goal>testXjc</goal> </goals> + <configuration> + <sourceType>WSDL</sourceType> + <testSources> + <testSource>test-resources/wsdl/ProxyDocLitWrapped.wsdl</testSource> + </testSources> + <packageName>org.test.proxy.doclitwrapped</packageName> + </configuration> </execution> + </executions> + </plugin> + <plugin> + <!-- Work around a problem in jaxb2-maven-plugin which confuses compile sources + and test sources, causing test sources to be included in the source JAR. + Should be fixed by https://github.com/mojohaus/jaxb2-maven-plugin/pull/94. --> + <artifactId>maven-source-plugin</artifactId> + <configuration> + <excludes> + <exclude>org/test/**</exclude> + </excludes> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <executions> <execution> <id>build-repo</id> <phase>test-compile</phase> @@ -264,29 +256,11 @@ </executions> </plugin> <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>build-helper-maven-plugin</artifactId> - <executions> - <execution> - <id>add-test-source</id> - <phase>process-test-resources</phase> - <goals> - <goal>add-test-source</goal> - </goals> - <configuration> - <sources> - <source>${basedir}/target/schema/src</source> - </sources> - </configuration> - </execution> - </executions> - </plugin> - <plugin> <artifactId>maven-surefire-plugin</artifactId> <inherited>true</inherited> <configuration> <argLine> - -Xbootclasspath/p:${project.build.directory}/endorsed/geronimo-jaxws_2.2_spec.jar + -Xbootclasspath/p:${jaxws.bootclasspath} </argLine> <includes> <include>**/*Tests.java</include> Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/metadata/src/org/apache/axis2/jaxws/description/builder/JAXWSRIWSDLGenerator.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/metadata/src/org/apache/axis2/jaxws/description/builder/JAXWSRIWSDLGenerator.java?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/metadata/src/org/apache/axis2/jaxws/description/builder/JAXWSRIWSDLGenerator.java (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/metadata/src/org/apache/axis2/jaxws/description/builder/JAXWSRIWSDLGenerator.java Sun Dec 17 22:34:08 2017 @@ -36,6 +36,7 @@ import org.apache.axis2.jaxws.util.Catal import org.apache.axis2.transport.http.HTTPConstants; import org.apache.axis2.util.SchemaUtil; import org.apache.axis2.wsdl.WSDLConstants; +import org.apache.axis2.wsdl.WSDLUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.ws.commons.schema.XmlSchema; @@ -47,7 +48,6 @@ import javax.servlet.ServletConfig; import javax.servlet.ServletContext; import javax.wsdl.Definition; import javax.wsdl.WSDLException; -import javax.wsdl.factory.WSDLFactory; import javax.wsdl.xml.WSDLReader; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.ws.WebServiceException; @@ -238,9 +238,8 @@ public class JAXWSRIWSDLGenerator implem for (File wsdlFile : wsdlFiles) { if (wsdlFile != null) { try { - WSDLFactory wsdlFactory = WSDLFactory.newInstance(); - WSDLReader wsdlReader = wsdlFactory.newWSDLReader(); - InputStream is = wsdlFile.toURL().openStream(); + WSDLReader wsdlReader = WSDLUtil.newWSDLReaderWithPopulatedExtensionRegistry(); + InputStream is = wsdlFile.toURI().toURL().openStream(); Definition definition = wsdlReader.readWSDL(localOutputDirectory, new InputSource(is)); try { @@ -332,7 +331,7 @@ public class JAXWSRIWSDLGenerator implem List<File> schemaFiles = getSchemaFiles(localOutputDirectory); for (File schemaFile : schemaFiles) { // generate dom document for current schema file - Document parsedDoc = fac.newDocumentBuilder().parse(schemaFile.toURL().toString()); + Document parsedDoc = fac.newDocumentBuilder().parse(schemaFile.toURI().toURL().toString()); // read the schema through XmlSchema XmlSchema doc = schemaCollection.read(parsedDoc.getDocumentElement(), UIDGenerator.generateUID()); Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java Sun Dec 17 22:34:08 2017 @@ -1010,7 +1010,12 @@ class OperationDescriptionImpl syncOperationDescription = opDesc; } if (log.isDebugEnabled()) { - log.debug("Synchronous operationDescription: " + syncOperationDescription); + if (syncOperationDescription != null) { + // Just log the operation name here, to avoid an infinite loop + log.debug("Synchronous operationDescription: " + syncOperationDescription.getOperationName()); + } else { + log.debug("Synchronous operationDescription: null"); + } } return syncOperationDescription; } @@ -2167,7 +2172,7 @@ class OperationDescriptionImpl WSDL4JWrapper wsdl4j = null; try { File file = new File(wsdlLocation); - URL url = file.toURL(); + URL url = file.toURI().toURL(); wsdl4j = new WSDL4JWrapper(url, true, 2); // In this context, limit the wsdl memory def = wsdl4j.getDefinition(); } catch (Throwable t) { @@ -2268,7 +2273,7 @@ class OperationDescriptionImpl string.append(sameline); string.append("SOAP Use: " + getSoapBindingUse()); string.append(sameline); - string.append("SOAP Paramater Style: " + getSoapBindingParameterStyle()); + string.append("SOAP Parameter Style: " + getSoapBindingParameterStyle()); // string.append(newline); string.append("Result name: " + getResultName()); @@ -2293,7 +2298,7 @@ class OperationDescriptionImpl string.append(newline); string.append("Java method name: " + getJavaMethodName()); string.append(newline); - string.append("Java paramaters: " + Arrays.toString(getJavaParameters())); + string.append("Java parameters: " + Arrays.toString(getJavaParameters())); string.append(newline); string.append("Service Implementation method: " + getMethodFromServiceImpl()); string.append(newline); @@ -2308,7 +2313,7 @@ class OperationDescriptionImpl string.append("Parameter Description: " + paramDesc.toString()); } } else { - string.append("No Paramater Descriptions"); + string.append("No Parameter Descriptions"); } string.append(newline); Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/metadata/src/org/apache/axis2/jaxws/description/impl/URIResolverImpl.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/metadata/src/org/apache/axis2/jaxws/description/impl/URIResolverImpl.java?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/metadata/src/org/apache/axis2/jaxws/description/impl/URIResolverImpl.java (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/metadata/src/org/apache/axis2/jaxws/description/impl/URIResolverImpl.java Sun Dec 17 22:34:08 2017 @@ -256,7 +256,7 @@ public class URIResolverImpl implements streamURL = (URL) AccessController.doPrivileged( new PrivilegedExceptionAction() { public Object run() throws MalformedURLException { - return file.toURL(); + return file.toURI().toURL(); } } ); Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/metadata/src/org/apache/axis2/jaxws/util/BaseWSDLLocator.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/metadata/src/org/apache/axis2/jaxws/util/BaseWSDLLocator.java?rev=1818518&r1=1818517&r2=1818518&view=diff ============================================================================== --- axis/axis2/java/core/branches/AXIS2-4091/modules/metadata/src/org/apache/axis2/jaxws/util/BaseWSDLLocator.java (original) +++ axis/axis2/java/core/branches/AXIS2-4091/modules/metadata/src/org/apache/axis2/jaxws/util/BaseWSDLLocator.java Sun Dec 17 22:34:08 2017 @@ -126,7 +126,7 @@ public abstract class BaseWSDLLocator { if(is == null){ try{ File file = new File(relativeLocation); - absoluteURL = file.toURL(); + absoluteURL = file.toURI().toURL(); is = absoluteURL.openStream(); lastestImportURI = absoluteURL.toExternalForm(); }
