You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by ve...@apache.org on 2017/07/01 18:31:50 UTC
svn commit: r1800521 [1/4] - in
/axis/axis2/java/core/branches/hermetic-tests: ./ apidocs/
databinding-tests/jaxbri-tests/ etc/ modules/adb-codegen/
modules/adb-codegen/src/org/apache/axis2/schema/template/
modules/adb-codegen/test-resources/testsuite/...
Author: veithen
Date: Sat Jul 1 18:31:49 2017
New Revision: 1800521
URL: http://svn.apache.org/viewvc?rev=1800521&view=rev
Log:
Merge latest changes from trunk.
Added:
axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/schema/axis2_5771/
- copied from r1800520, axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/schema/axis2_5771/
axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/xsd/
- copied from r1800520, axis/axis2/java/core/trunk/modules/adb-tests/src/test/xsd/
axis/axis2/java/core/branches/hermetic-tests/modules/codegen/src/org/apache/axis2/util/
- copied from r1800520, axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/util/
axis/axis2/java/core/branches/hermetic-tests/modules/tool/axis2-wsdl2code-maven-plugin/src/it/
- copied from r1800520, axis/axis2/java/core/trunk/modules/tool/axis2-wsdl2code-maven-plugin/src/it/
axis/axis2/java/core/branches/hermetic-tests/modules/tool/axis2-xsd2java-maven-plugin/
- copied from r1800520, axis/axis2/java/core/trunk/modules/tool/axis2-xsd2java-maven-plugin/
axis/axis2/java/core/branches/hermetic-tests/modules/tool/maven-shared/
- copied from r1800520, axis/axis2/java/core/trunk/modules/tool/maven-shared/
Removed:
axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/sub-build.xml
axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/util/InvokerThread.java
axis/axis2/java/core/branches/hermetic-tests/modules/jaxws-integration/test/org/apache/axis2/jaxws/dispatch/CallbackHandler.java
axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/util/PrettyPrinter.java
axis/axis2/java/core/branches/hermetic-tests/modules/tool/axis2-wsdl2code-maven-plugin/src/main/java/org/apache/axis2/maven2/wsdl2code/NamespaceURIMapping.java
axis/axis2/java/core/branches/hermetic-tests/modules/tool/axis2-wsdl2code-maven-plugin/src/test/java/
axis/axis2/java/core/branches/hermetic-tests/modules/tool/axis2-wsdl2code-maven-plugin/src/test/test1/
axis/axis2/java/core/branches/hermetic-tests/modules/tool/axis2-wsdl2code-maven-plugin/src/test/test2/
axis/axis2/java/core/branches/hermetic-tests/modules/transport/testkit/src/main/java/org/apache/axis2/transport/testkit/util/ContentTypeUtil.java
Modified:
axis/axis2/java/core/branches/hermetic-tests/ (props changed)
axis/axis2/java/core/branches/hermetic-tests/apidocs/pom.xml
axis/axis2/java/core/branches/hermetic-tests/databinding-tests/jaxbri-tests/pom.xml
axis/axis2/java/core/branches/hermetic-tests/etc/doap_Axis2.rdf
axis/axis2/java/core/branches/hermetic-tests/modules/adb-codegen/pom.xml
axis/axis2/java/core/branches/hermetic-tests/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-bean.xsl
axis/axis2/java/core/branches/hermetic-tests/modules/adb-codegen/test-resources/testsuite/base64binary.xsd
axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/pom.xml
axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/schema/AbstractTestCase.java
axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/schema/base64binary/Base64BinaryTest.java
axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/schema/defaultnamespaces/DefaultNamespacesTest.java
axis/axis2/java/core/branches/hermetic-tests/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
axis/axis2/java/core/branches/hermetic-tests/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
axis/axis2/java/core/branches/hermetic-tests/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
axis/axis2/java/core/branches/hermetic-tests/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingOutHandlerTest.java
axis/axis2/java/core/branches/hermetic-tests/modules/codegen/pom.xml
axis/axis2/java/core/branches/hermetic-tests/modules/corba/src/org/apache/axis2/corba/deployer/CorbaDeployer.java
axis/axis2/java/core/branches/hermetic-tests/modules/fastinfoset/pom.xml
axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/HandlerFailureTest.java
axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/ThreadingTest.java
axis/axis2/java/core/branches/hermetic-tests/modules/jaxws-integration/pom.xml
axis/axis2/java/core/branches/hermetic-tests/modules/jaxws-integration/test/org/apache/axis2/jaxws/dispatch/DOMSourceDispatchTests.java
axis/axis2/java/core/branches/hermetic-tests/modules/jaxws-integration/test/org/apache/axis2/jaxws/dispatch/SAXSourceDispatchTests.java
axis/axis2/java/core/branches/hermetic-tests/modules/jaxws-integration/test/org/apache/axis2/jaxws/dispatch/StreamSourceDispatchTests.java
axis/axis2/java/core/branches/hermetic-tests/modules/jaxws-integration/test/org/apache/axis2/jaxws/xmlhttp/DispatchXMessageSourceTests.java
axis/axis2/java/core/branches/hermetic-tests/modules/jaxws-integration/test/org/apache/axis2/jaxws/xmlhttp/DispatchXPayloadSourceTests.java
axis/axis2/java/core/branches/hermetic-tests/modules/jaxws/src/org/apache/axis2/jaxws/framework/JAXWSDeployer.java
axis/axis2/java/core/branches/hermetic-tests/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/SourceBlockImpl.java
axis/axis2/java/core/branches/hermetic-tests/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/XMLStringBlockImpl.java
axis/axis2/java/core/branches/hermetic-tests/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java
axis/axis2/java/core/branches/hermetic-tests/modules/jaxws/src/org/apache/axis2/jaxws/message/util/Reader2Writer.java
axis/axis2/java/core/branches/hermetic-tests/modules/jaxws/test/org/apache/axis2/jaxws/message/BlockTests.java
axis/axis2/java/core/branches/hermetic-tests/modules/jaxws/test/org/apache/axis2/jaxws/message/SOAP12Tests.java
axis/axis2/java/core/branches/hermetic-tests/modules/jibx/pom.xml
axis/axis2/java/core/branches/hermetic-tests/modules/json/pom.xml
axis/axis2/java/core/branches/hermetic-tests/modules/json/src/org/apache/axis2/json/JSONUtil.java
axis/axis2/java/core/branches/hermetic-tests/modules/json/test/org/apache/axis2/json/JSONDataSourceTest.java
axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/AxisFault.java
axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/dataretrieval/AxisDataLocatorImpl.java
axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java
axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/ClusterBuilder.java
axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/DeploymentClassLoader.java
axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java
axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/ModuleBuilder.java
axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/ModuleDeployer.java
axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java
axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/ServiceDeployer.java
axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/ServiceGroupBuilder.java
axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/TransportDeployer.java
axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java
axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java
axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/description/ParameterIncludeImpl.java
axis/axis2/java/core/branches/hermetic-tests/modules/kernel/test/org/apache/axis2/deployment/AddressingIdentityServiceTest.java
axis/axis2/java/core/branches/hermetic-tests/modules/mex/src/org/apache/axis2/mex/om/Metadata.java
axis/axis2/java/core/branches/hermetic-tests/modules/mex/src/org/apache/axis2/mex/util/MexUtil.java
axis/axis2/java/core/branches/hermetic-tests/modules/osgi-tests/pom.xml
axis/axis2/java/core/branches/hermetic-tests/modules/osgi-tests/src/test/java/OSGiTest.java
axis/axis2/java/core/branches/hermetic-tests/modules/osgi/pom.xml
axis/axis2/java/core/branches/hermetic-tests/modules/osgi/src/org/apache/axis2/osgi/deployment/OSGiServiceGroupBuilder.java
axis/axis2/java/core/branches/hermetic-tests/modules/ping/src/org/apache/axis2/ping/PingMessageReceiver.java
axis/axis2/java/core/branches/hermetic-tests/modules/saaj/src/org/apache/axis2/saaj/SOAPBodyImpl.java
axis/axis2/java/core/branches/hermetic-tests/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java
axis/axis2/java/core/branches/hermetic-tests/modules/saaj/src/org/apache/axis2/saaj/SOAPEnvelopeImpl.java
axis/axis2/java/core/branches/hermetic-tests/modules/saaj/src/org/apache/axis2/saaj/SOAPFaultImpl.java
axis/axis2/java/core/branches/hermetic-tests/modules/saaj/src/org/apache/axis2/saaj/SOAPHeaderElementImpl.java
axis/axis2/java/core/branches/hermetic-tests/modules/saaj/src/org/apache/axis2/saaj/SOAPHeaderImpl.java
axis/axis2/java/core/branches/hermetic-tests/modules/saaj/src/org/apache/axis2/saaj/SOAPMessageImpl.java
axis/axis2/java/core/branches/hermetic-tests/modules/saaj/test/org/apache/axis2/saaj/AttachmentTest.java
axis/axis2/java/core/branches/hermetic-tests/modules/saaj/test/org/apache/axis2/saaj/SOAPEnvelopeTest.java
axis/axis2/java/core/branches/hermetic-tests/modules/saaj/test/org/apache/axis2/saaj/SOAPHeaderTest.java
axis/axis2/java/core/branches/hermetic-tests/modules/tool/axis2-java2wsdl-maven-plugin/pom.xml
axis/axis2/java/core/branches/hermetic-tests/modules/tool/axis2-wsdl2code-maven-plugin/pom.xml
axis/axis2/java/core/branches/hermetic-tests/modules/tool/axis2-wsdl2code-maven-plugin/src/main/java/org/apache/axis2/maven2/wsdl2code/AbstractWSDL2CodeMojo.java
axis/axis2/java/core/branches/hermetic-tests/modules/transport/base/src/main/java/org/apache/axis2/transport/base/endpoint/config/URLEndpointFactory.java
axis/axis2/java/core/branches/hermetic-tests/modules/transport/base/src/main/java/org/apache/axis2/transport/base/endpoint/config/URLEndpointsConfigurationFactory.java
axis/axis2/java/core/branches/hermetic-tests/modules/transport/tcp/test/org/apache/axis2/transport/tcp/TCPEchoRawXMLTest.java
axis/axis2/java/core/branches/hermetic-tests/modules/transport/tcp/test/org/apache/axis2/transport/tcp/TCPTwoChannelEchoRawXMLTest.java
axis/axis2/java/core/branches/hermetic-tests/modules/transport/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/client/AxisTestClient.java
axis/axis2/java/core/branches/hermetic-tests/modules/transport/testkit/src/main/java/org/apache/axis2/transport/testkit/message/MessageEncoder.java
axis/axis2/java/core/branches/hermetic-tests/modules/transport/xmpp/src/org/apache/axis2/transport/xmpp/XMPPListener.java
axis/axis2/java/core/branches/hermetic-tests/modules/webapp/pom.xml
axis/axis2/java/core/branches/hermetic-tests/modules/webapp/src/main/java/org/apache/axis2/webapp/AdminActions.java
axis/axis2/java/core/branches/hermetic-tests/modules/webapp/src/main/webapp/WEB-INF/views/admin/SelectService.jsp
axis/axis2/java/core/branches/hermetic-tests/pom.xml
axis/axis2/java/core/branches/hermetic-tests/src/site/markdown/release-notes/1.8.0.md
axis/axis2/java/core/branches/hermetic-tests/src/site/xdoc/tools/index.xml
axis/axis2/java/core/branches/hermetic-tests/systests/webapp-tests/src/test/java/org/apache/axis2/webapp/AxisAdminServletITCase.java
Propchange: axis/axis2/java/core/branches/hermetic-tests/
------------------------------------------------------------------------------
--- svn:auto-props (original)
+++ svn:auto-props Sat Jul 1 18:31:49 2017
@@ -1,2 +1,3 @@
*.java = svn:eol-style=native
*.xml = svn:eol-style=native
+*.md = svn:eol-style=native
Propchange: axis/axis2/java/core/branches/hermetic-tests/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Jul 1 18:31:49 2017
@@ -1,4 +1,5 @@
/axis/axis2/java/core/branches/1_6:1295540
/axis/axis2/java/core/branches/AXIOM-420:1334386-1336397
/axis/axis2/java/core/branches/AXIS2-4318:1230452,1295542,1324772,1327468,1329571,1332141,1335355,1335357,1340985
-/axis/axis2/java/core/trunk:1779063-1793310
+/axis/axis2/java/core/branches/AXIS2-5785:1793298-1793391
+/axis/axis2/java/core/trunk:1779063-1800520
Modified: axis/axis2/java/core/branches/hermetic-tests/apidocs/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/apidocs/pom.xml?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/apidocs/pom.xml (original)
+++ axis/axis2/java/core/branches/hermetic-tests/apidocs/pom.xml Sat Jul 1 18:31:49 2017
@@ -218,6 +218,11 @@
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
+ <artifactId>axis2-xsd2java-maven-plugin</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
<artifactId>simple-server-maven-plugin</artifactId>
<version>${project.version}</version>
</dependency>
Modified: axis/axis2/java/core/branches/hermetic-tests/databinding-tests/jaxbri-tests/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/databinding-tests/jaxbri-tests/pom.xml?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/databinding-tests/jaxbri-tests/pom.xml (original)
+++ axis/axis2/java/core/branches/hermetic-tests/databinding-tests/jaxbri-tests/pom.xml Sat Jul 1 18:31:49 2017
@@ -105,16 +105,16 @@
<generateServerSide>true</generateServerSide>
<generateServerSideInterface>true</generateServerSideInterface>
<generateServicesXml>true</generateServicesXml>
- <namespaceURIs>
- <namespaceURI>
+ <namespaceMappings>
+ <namespaceMapping>
<uri>http://www.example.org/data</uri>
<packageName>org.apache.axis2.jaxbri.processor.data</packageName>
- </namespaceURI>
- <namespaceURI>
+ </namespaceMapping>
+ <namespaceMapping>
<uri>http://www.example.org/ws</uri>
<packageName>org.apache.axis2.jaxbri.processor.service</packageName>
- </namespaceURI>
- </namespaceURIs>
+ </namespaceMapping>
+ </namespaceMappings>
<outputDirectory>${project.build.directory}/gen/processor</outputDirectory>
</configuration>
</execution>
@@ -125,16 +125,16 @@
</goals>
<configuration>
<wsdlFile>src/test/wsdl/processor.wsdl</wsdlFile>
- <namespaceURIs>
- <namespaceURI>
+ <namespaceMappings>
+ <namespaceMapping>
<uri>http://www.example.org/data</uri>
<packageName>org.apache.axis2.jaxbri.processor.data</packageName>
- </namespaceURI>
- <namespaceURI>
+ </namespaceMapping>
+ <namespaceMapping>
<uri>http://www.example.org/ws</uri>
<packageName>org.apache.axis2.jaxbri.processor.client</packageName>
- </namespaceURI>
- </namespaceURIs>
+ </namespaceMapping>
+ </namespaceMappings>
<outputDirectory>${project.build.directory}/gen/processor</outputDirectory>
</configuration>
</execution>
@@ -150,12 +150,12 @@
<generateServicesXml>true</generateServicesXml>
<generateAllClasses>true</generateAllClasses>
<packageName>org.apache.axis2.jaxbri.identityservice</packageName>
- <namespaceURIs>
- <namespaceURI>
+ <namespaceMappings>
+ <namespaceMapping>
<uri>http://www.example.org/identity</uri>
<packageName>org.apache.axis2.jaxbri.identityservice</packageName>
- </namespaceURI>
- </namespaceURIs>
+ </namespaceMapping>
+ </namespaceMappings>
<outputDirectory>${project.build.directory}/gen/identityservice</outputDirectory>
</configuration>
</execution>
@@ -171,12 +171,12 @@
<generateServicesXml>true</generateServicesXml>
<generateAllClasses>true</generateAllClasses>
<packageName>org.apache.axis2.jaxbri.mtom</packageName>
- <namespaceURIs>
- <namespaceURI>
+ <namespaceMappings>
+ <namespaceMapping>
<uri>http://www.example.org/mtom/</uri>
<packageName>org.apache.axis2.jaxbri.mtom</packageName>
- </namespaceURI>
- </namespaceURIs>
+ </namespaceMapping>
+ </namespaceMappings>
<outputDirectory>${project.build.directory}/gen/mtom</outputDirectory>
</configuration>
</execution>
Modified: axis/axis2/java/core/branches/hermetic-tests/etc/doap_Axis2.rdf
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/etc/doap_Axis2.rdf?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/etc/doap_Axis2.rdf (original)
+++ axis/axis2/java/core/branches/hermetic-tests/etc/doap_Axis2.rdf Sat Jul 1 18:31:49 2017
@@ -69,6 +69,7 @@
<release><Version><name>Apache Axis2</name><created>2016-05-02</created><revision>1.7.2</revision></Version></release>
<release><Version><name>Apache Axis2</name><created>2016-05-30</created><revision>1.7.3</revision></Version></release>
<release><Version><name>Apache Axis2</name><created>2016-10-21</created><revision>1.7.4</revision></Version></release>
+ <release><Version><name>Apache Axis2</name><created>2017-05-06</created><revision>1.7.5</revision></Version></release>
<repository>
<SVNRepository>
Modified: axis/axis2/java/core/branches/hermetic-tests/modules/adb-codegen/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/adb-codegen/pom.xml?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/adb-codegen/pom.xml (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/adb-codegen/pom.xml Sat Jul 1 18:31:49 2017
@@ -64,11 +64,6 @@
<artifactId>xmlunit</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>com.sun.mail</groupId>
- <artifactId>javax.mail</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
<url>http://axis.apache.org/axis2/java/core/</url>
<scm>
Modified: axis/axis2/java/core/branches/hermetic-tests/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-bean.xsl
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-bean.xsl?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-bean.xsl (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-bean.xsl Sat Jul 1 18:31:49 2017
@@ -1811,16 +1811,17 @@
</xsl:choose>
// handle unexpected enumeration values properly
- <xsl:if test="$ignoreunexpected">
- log.warn("Unexpected value " + value + " for enumeration <xsl:value-of select="$name"/>");
- return enumeration;
- </xsl:if>
- <xsl:if test="not($ignoreunexpected)">
- if (enumeration == null <xsl:if test="$propertyType='string'">&& !((value == null) || (value.equals("")))</xsl:if>) {
- throw new java.lang.IllegalArgumentException();
- }
- return enumeration;
- </xsl:if>
+ if (enumeration == null <xsl:if test="$propertyType='string'">&& !((value == null) || (value.equals("")))</xsl:if>) {
+ <xsl:choose>
+ <xsl:when test="$ignoreunexpected">
+ log.warn("Unexpected value " + value + " for enumeration <xsl:value-of select="$name"/>");
+ </xsl:when>
+ <xsl:otherwise>
+ throw new java.lang.IllegalArgumentException();
+ </xsl:otherwise>
+ </xsl:choose>
+ }
+ return enumeration;
}
public static <xsl:value-of select="$name"/> fromString(java.lang.String value,java.lang.String namespaceURI)
throws java.lang.IllegalArgumentException {
Modified: axis/axis2/java/core/branches/hermetic-tests/modules/adb-codegen/test-resources/testsuite/base64binary.xsd
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/adb-codegen/test-resources/testsuite/base64binary.xsd?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/adb-codegen/test-resources/testsuite/base64binary.xsd (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/adb-codegen/test-resources/testsuite/base64binary.xsd Sat Jul 1 18:31:49 2017
@@ -36,7 +36,7 @@
</xs:complexType>
</xs:element>
- <xs:element name="TestBase64BinaryOnbounded">
+ <xs:element name="TestBase64BinaryUnbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="param" type="xs:base64Binary" maxOccurs="unbounded"/>
Modified: axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/pom.xml?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/pom.xml (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/pom.xml Sat Jul 1 18:31:49 2017
@@ -43,13 +43,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <!-- TODO: remove this when we switch to the axis2-xsd2java-maven plugin -->
- <groupId>${project.groupId}</groupId>
- <artifactId>axis2-adb-codegen</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>${project.groupId}</groupId>
<artifactId>axis2-transport-local</artifactId>
<version>${project.version}</version>
@@ -86,53 +79,122 @@
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>axis2-xsd2java-maven-plugin</artifactId>
+ <version>${project.version}</version>
<executions>
<execution>
- <id>generate-test-sources</id>
- <phase>generate-test-sources</phase>
+ <id>xsd2java</id>
+ <goals>
+ <goal>generate-test-sources</goal>
+ </goals>
+ <configuration>
+ <xsdFiles>
+ <xsdFile>../adb-codegen/test-resources/xsd/simple_maxOccurs2.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/xsd/anonymous_complexType.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/xsd/simple_choice.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/xsd/simple_particle_all.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/xsd/simple_maxOccurs.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/xsd/simple_anytype.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/xsd/simple-minoccurs0.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/xsd/complex-minoccurs0.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/xsd/simple-recursive-datatypes.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/xsd/mixed_minoccus0.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/xsd/simple/simpleType-All.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/xsd/derived/derivedType-All.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/testsuite.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/extensions.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/union.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/all.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/enumeration.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/restrictions.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/choice.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/list.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/references.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/innerchoice.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/attribute.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/boolean.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/particlemaxoccurs.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/innerParticles.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/default_namespaces.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/groups.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/base64binary.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/abstract.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/decimal.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/anytype.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/innerParticleExtension.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/union2.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/default_value.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/complexExtension.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/chameleon.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/nonamespace.xsd</xsdFile> <!-- compile only; no tests -->
+ <xsdFile>../adb-codegen/test-resources/testsuite/unqualified.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/unqualified/companyservice.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/names.xsd</xsdFile> <!-- compile only; no tests -->
+ <xsdFile>../adb-codegen/test-resources/testsuite/std-schemas.xsd</xsdFile> <!-- compile only; no tests -->
+ <xsdFile>../adb-codegen/test-resources/xsd/fixed_value.xsd</xsdFile>
+ </xsdFiles>
+ </configuration>
+ </execution>
+ <execution>
+ <id>xsd2java-nonamespace</id>
+ <goals>
+ <goal>generate-test-sources</goal>
+ </goals>
<configuration>
- <tasks unless="maven.test.skip">
- <property name="maven.junit.jvmargs" value="" />
- <path id="maven.dependency.classpath">
- <path refid="maven.test.classpath" />
- </path>
- <property name="compiled.classes.dir" value="target/classes" />
- <!-- Theres got to be a better way to do this -->
- <property name="schema.source.dir" value="../adb-codegen/test-resources/xsd" />
- <property name="testsuite.source.dir" value="../adb-codegen/test-resources/testsuite" />
- <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" />
- <ant antfile="sub-build.xml" inheritall="true" inheritrefs="true" dir="." target="main" />
- </tasks>
+ <xsdFiles>
+ <xsdFile>../adb-codegen/test-resources/testsuite/nonamespace.xsd</xsdFile>
+ </xsdFiles>
+ <noNamespacePackageName>org.apache.axis2.schema.nonamespace</noNamespacePackageName>
+ <mapperClassPackage>org.apache.axis2.schema.nonamespace</mapperClassPackage>
</configuration>
+ </execution>
+ <execution>
+ <id>xsd2java-helper-mode</id>
<goals>
- <goal>run</goal>
+ <goal>generate-test-sources</goal>
</goals>
+ <configuration>
+ <xsdFiles>
+ <xsdFile>../adb-codegen/test-resources/testsuite/testsuite.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/all.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/boolean.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/chameleon.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/choice.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/decimal.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/default_value.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/enumeration.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/groups.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/innerchoice.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/innerParticleExtension.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/unqualified.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/unqualified/companyservice.xsd</xsdFile>
+ <xsdFile>../adb-codegen/test-resources/testsuite/names.xsd</xsdFile> <!-- compile only; no tests -->
+ </xsdFiles>
+ <helperMode>true</helperMode>
+ <packageName>helper.</packageName>
+ </configuration>
</execution>
- </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>
+ <id>xsd2java-axis2-5771</id>
<goals>
- <goal>add-test-source</goal>
+ <goal>generate-test-sources</goal>
</goals>
<configuration>
- <sources>
- <source>${basedir}/target/schema/src</source>
- </sources>
+ <xsdFiles>
+ <xsdFile>src/test/xsd/AXIS2-5771.xsd</xsdFile>
+ </xsdFiles>
+ <ignoreUnexpected>true</ignoreUnexpected>
</configuration>
</execution>
</executions>
@@ -189,12 +251,12 @@
<wsdlFile>src/test/wsdl/AXIS2-5750.wsdl</wsdlFile>
<syncMode>sync</syncMode>
<unpackClasses>true</unpackClasses>
- <namespaceURIs>
- <namespaceURI>
+ <namespaceMappings>
+ <namespaceMapping>
<uri>http://ise-online.com/FixedValueService/</uri>
<packageName>org.apache.axis2.databinding.axis2_5750.client</packageName>
- </namespaceURI>
- </namespaceURIs>
+ </namespaceMapping>
+ </namespaceMappings>
<packageName>org.apache.axis2.databinding.axis2_5750.client</packageName>
<outputDirectory>${project.build.directory}/wsdl2code/AXIS2-5750</outputDirectory>
</configuration>
@@ -208,12 +270,12 @@
<wsdlFile>src/test/wsdl/AXIS2-5758.wsdl</wsdlFile>
<syncMode>sync</syncMode>
<unpackClasses>true</unpackClasses>
- <namespaceURIs>
- <namespaceURI>
+ <namespaceMappings>
+ <namespaceMapping>
<uri>http://example.com/stockquote.xsd</uri>
<packageName>org.apache.axis2.databinding.axis2_5758.client</packageName>
- </namespaceURI>
- </namespaceURIs>
+ </namespaceMapping>
+ </namespaceMappings>
<packageName>org.apache.axis2.databinding.axis2_5758.client</packageName>
<outputDirectory>${project.build.directory}/wsdl2code/AXIS2-5758</outputDirectory>
</configuration>
@@ -227,12 +289,12 @@
<wsdlFile>src/test/wsdl/AXIS2-5799.wsdl</wsdlFile>
<syncMode>sync</syncMode>
<unpackClasses>true</unpackClasses>
- <namespaceURIs>
- <namespaceURI>
+ <namespaceMappings>
+ <namespaceMapping>
<uri>urn:echo</uri>
<packageName>org.apache.axis2.databinding.axis2_5799.client</packageName>
- </namespaceURI>
- </namespaceURIs>
+ </namespaceMapping>
+ </namespaceMappings>
<packageName>org.apache.axis2.databinding.axis2_5799.client</packageName>
<outputDirectory>${project.build.directory}/wsdl2code/AXIS2-5799</outputDirectory>
</configuration>
@@ -246,12 +308,12 @@
<wsdlFile>src/test/wsdl/AXIS2-5809.wsdl</wsdlFile>
<syncMode>sync</syncMode>
<unpackClasses>true</unpackClasses>
- <namespaceURIs>
- <namespaceURI>
+ <namespaceMappings>
+ <namespaceMapping>
<uri>http://apache.org/axis2/echo</uri>
<packageName>org.apache.axis2.databinding.axis2_5809</packageName>
- </namespaceURI>
- </namespaceURIs>
+ </namespaceMapping>
+ </namespaceMappings>
<packageName>org.apache.axis2.databinding.axis2_5809</packageName>
<generateServerSide>true</generateServerSide>
<generateAllClasses>true</generateAllClasses>
Modified: axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/schema/AbstractTestCase.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/schema/AbstractTestCase.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/schema/AbstractTestCase.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/schema/AbstractTestCase.java Sat Jul 1 18:31:49 2017
@@ -25,8 +25,6 @@ import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
import java.io.OutputStream;
import java.io.StringReader;
import java.io.StringWriter;
@@ -44,6 +42,7 @@ import java.util.Set;
import javax.activation.DataHandler;
import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
@@ -53,9 +52,11 @@ import org.apache.axiom.om.OMAbstractFac
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMOutputFormat;
import org.apache.axiom.om.OMXMLBuilderFactory;
+import org.apache.axiom.om.ds.AbstractPushOMDataSource;
import org.apache.axiom.om.util.StAXUtils;
import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.SOAPModelBuilder;
+import org.apache.axiom.testutils.io.IOTestUtils;
import org.apache.axis2.databinding.ADBBean;
import org.apache.axis2.databinding.ADBException;
import org.apache.axis2.databinding.types.HexBinary;
@@ -103,7 +104,7 @@ public abstract class AbstractTestCase e
* @param expected
* @param actual
*/
- public static void assertBeanEquals(Object expected, Object actual) {
+ public static void assertBeanEquals(Object expected, Object actual) throws Exception {
if (expected == null) {
assertNull(actual);
return;
@@ -127,7 +128,7 @@ public abstract class AbstractTestCase e
}
}
- private static void assertPropertyValueEquals(String message, Object expected, Object actual) {
+ private static void assertPropertyValueEquals(String message, Object expected, Object actual) throws Exception {
if (expected == null) {
assertNull(message, actual);
} else {
@@ -143,7 +144,9 @@ public abstract class AbstractTestCase e
} else if (simpleJavaTypes.contains(type)) {
assertEquals("value for " + message, expected, actual);
} else if (DataHandler.class.isAssignableFrom(type)) {
- assertDataHandlerEquals((DataHandler)expected, (DataHandler)actual);
+ IOTestUtils.compareStreams(
+ ((DataHandler)expected).getInputStream(), "expected",
+ ((DataHandler)actual).getInputStream(), "actual");
} else if (OMElement.class.isAssignableFrom(type)) {
assertTrue(isOMElementsEqual((OMElement)expected, (OMElement)actual));
} else if (isADBBean(type)) {
@@ -195,20 +198,6 @@ public abstract class AbstractTestCase e
return count;
}
- private static void assertDataHandlerEquals(DataHandler expected, DataHandler actual) {
- try {
- InputStream in1 = expected.getInputStream();
- InputStream in2 = actual.getInputStream();
- int b;
- do {
- b = in1.read();
- assertEquals(b, in2.read());
- } while (b != -1);
- } catch (IOException ex) {
- fail("Failed to read data handler");
- }
- }
-
public static Object toHelperModeBean(ADBBean bean) throws Exception {
Class<?> beanClass = bean.getClass();
Object helperModeBean = null;
@@ -337,14 +326,26 @@ public abstract class AbstractTestCase e
// Approach 3: Serialize the bean as the child of an element that declares a default namespace.
// If ADB behaves correctly, this should not have any impact. A failure here may be an indication
// of an incorrect usage of XMLStreamWriter#writeStartElement(String).
- private static void testSerializeDeserializeWrapped(Object bean, Object expectedResult) throws Exception {
+ private static void testSerializeDeserializeWrapped(final Object bean, Object expectedResult) throws Exception {
StringWriter sw = new StringWriter();
- XMLStreamWriter writer = StAXUtils.createXMLStreamWriter(sw);
- writer.writeStartElement("", "root", "urn:test");
- writer.writeDefaultNamespace("urn:test");
- ADBBeanUtil.serialize(bean, writer);
- writer.writeEndElement();
- writer.flush();
+ OMAbstractFactory.getOMFactory().createOMElement(new AbstractPushOMDataSource() {
+ @Override
+ public boolean isDestructiveWrite() {
+ return false;
+ }
+
+ @Override
+ public void serialize(XMLStreamWriter writer) throws XMLStreamException {
+ writer.writeStartElement("", "root", "urn:test");
+ writer.writeDefaultNamespace("urn:test");
+ try {
+ ADBBeanUtil.serialize(bean, writer);
+ } catch (Exception ex) {
+ throw new XMLStreamException(ex);
+ }
+ writer.writeEndElement();
+ }
+ }).serialize(sw);
OMElement omElement3 = OMXMLBuilderFactory.createOMBuilder(new StringReader(sw.toString())).getDocumentElement();
assertBeanEquals(expectedResult, ADBBeanUtil.parse(bean.getClass(), omElement3.getFirstElement().getXMLStreamReader()));
}
Modified: axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/schema/base64binary/Base64BinaryTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/schema/base64binary/Base64BinaryTest.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/schema/base64binary/Base64BinaryTest.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/schema/base64binary/Base64BinaryTest.java Sat Jul 1 18:31:49 2017
@@ -20,6 +20,7 @@
package org.apache.axis2.schema.base64binary;
import org.apache.axiom.attachments.ByteArrayDataSource;
+import org.apache.axiom.testutils.activation.RandomDataSource;
import org.apache.axis2.schema.AbstractTestCase;
import org.w3.www._2005._05.xmlmime.*;
@@ -78,12 +79,12 @@ public class Base64BinaryTest extends Ab
testSerializeDeserialize(testBase64MultiElement);
}
- public void testBase64BinaryOnbounded() throws Exception {
- TestBase64BinaryOnbounded bean = new TestBase64BinaryOnbounded();
+ public void testBase64BinaryUnbounded() throws Exception {
+ TestBase64BinaryUnbounded bean = new TestBase64BinaryUnbounded();
bean.setParam(new DataHandler[] {
- new DataHandler("DataHandler 1", "text/plain"),
- new DataHandler("DataHandler 2", "text/plain"),
- new DataHandler("DataHandler 3", "text/plain")
+ new DataHandler(new RandomDataSource(1024)),
+ new DataHandler(new RandomDataSource(1024)),
+ new DataHandler(new RandomDataSource(1024))
});
testSerializeDeserialize(bean);
}
Modified: axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/schema/defaultnamespaces/DefaultNamespacesTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/schema/defaultnamespaces/DefaultNamespacesTest.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/schema/defaultnamespaces/DefaultNamespacesTest.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/schema/defaultnamespaces/DefaultNamespacesTest.java Sat Jul 1 18:31:49 2017
@@ -20,19 +20,16 @@
package org.apache.axis2.schema.defaultnamespaces;
import junit.framework.TestCase;
-import org.apache.axiom.om.util.StAXUtils;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-import java.io.ByteArrayInputStream;
-import java.io.StringWriter;
public class DefaultNamespacesTest extends TestCase {
private static final String NS_URI = TestElement1.MY_QNAME.getNamespaceURI();
- public void testTestElement1() {
+ public void testTestElement1() throws Exception {
TestElement1 testElement1 = new TestElement1();
@@ -55,33 +52,17 @@ public class DefaultNamespacesTest exten
testElement1.setTestElement1(testChildType);
- StringWriter stringWriter = new StringWriter();
-
- try {
-
- XMLStreamWriter xmlStreamWriter = StAXUtils.createXMLStreamWriter(stringWriter);
- testElement1.getTestElement1().serialize(new QName(NS_URI, "TestElement1", "ns1"),
- xmlStreamWriter);
- xmlStreamWriter.flush();
- xmlStreamWriter.close();
- String omElementString = stringWriter.toString();
- System.out.println("OM String ==> " + omElementString);
- XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
- TestElement1 result = TestElement1.Factory.parse(xmlReader);
- assertTrue(result.getTestElement1() instanceof TestChildType);
- TestChildType resultType = (TestChildType) result.getTestElement1();
- assertEquals(resultType.getParam1(), new QName(NS_URI, "param1"));
- assertEquals(resultType.getParam2(), "Param2");
- assertEquals(resultType.getParam3(), new QName(NS_URI, "param3"));
- assertEquals(resultType.getParam4(), "Param4");
- assertEquals(resultType.getAttribute1(), "attribute1");
- assertEquals(resultType.getAttribute2(), new QName(NS_URI, "attribute2"));
- } catch (XMLStreamException e) {
- fail();
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
+ OMElement omElement = testElement1.getTestElement1().getOMElement(new QName(NS_URI, "TestElement1", "ns1"),
+ OMAbstractFactory.getOMFactory());
+ TestElement1 result = TestElement1.Factory.parse(omElement.getXMLStreamReader());
+ assertTrue(result.getTestElement1() instanceof TestChildType);
+ TestChildType resultType = (TestChildType) result.getTestElement1();
+ assertEquals(resultType.getParam1(), new QName(NS_URI, "param1"));
+ assertEquals(resultType.getParam2(), "Param2");
+ assertEquals(resultType.getParam3(), new QName(NS_URI, "param3"));
+ assertEquals(resultType.getParam4(), "Param4");
+ assertEquals(resultType.getAttribute1(), "attribute1");
+ assertEquals(resultType.getAttribute2(), new QName(NS_URI, "attribute2"));
}
}
Modified: axis/axis2/java/core/branches/hermetic-tests/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java Sat Jul 1 18:31:49 2017
@@ -173,7 +173,7 @@ public class SimpleTypeMapper {
}
public static ArrayList getArrayList(OMElement element, String localName) {
- Iterator childitr = element.getChildrenWithName(new QName(localName));
+ Iterator<OMElement> childitr = element.getChildrenWithName(new QName(localName));
ArrayList list = new ArrayList();
while (childitr.hasNext()) {
Object o = childitr.next();
@@ -183,10 +183,10 @@ public class SimpleTypeMapper {
}
public static HashSet getHashSet(OMElement element, String localName) {
- Iterator childitr = element.getChildrenWithName(new QName(localName));
+ Iterator<OMElement> childitr = element.getChildrenWithName(new QName(localName));
final HashSet list = new HashSet();
while (childitr.hasNext()) {
- OMElement o = (OMElement) childitr.next();
+ OMElement o = childitr.next();
list.add(o.getText());
}
return list;
Modified: axis/axis2/java/core/branches/hermetic-tests/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java Sat Jul 1 18:31:49 2017
@@ -1710,7 +1710,7 @@ public class BeanUtil {
* Fix for AXIS2-5090. Use siblings with same QName instead of look for
* children because list elements available on same level.
*/
- Iterator parts = omElement.getParent().getChildrenWithName(partName);
+ Iterator<OMElement> parts = omElement.getParent().getChildrenWithName(partName);
return processGenericsElement(parameter, omElement, helper, parts,
objectSupplier, generictype);
}
Modified: axis/axis2/java/core/branches/hermetic-tests/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java Sat Jul 1 18:31:49 2017
@@ -568,7 +568,7 @@ public class AddressingOutHandler extend
if (multipleHeaders) {
if (replaceHeaders) {
QName qname = new QName(addressingNamespace, name, WSA_DEFAULT_PREFIX);
- Iterator iterator = header.getChildrenWithName(qname);
+ Iterator<OMElement> iterator = header.getChildrenWithName(qname);
while (iterator.hasNext()) {
iterator.next();
iterator.remove();
Modified: axis/axis2/java/core/branches/hermetic-tests/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingOutHandlerTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingOutHandlerTest.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingOutHandlerTest.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingOutHandlerTest.java Sat Jul 1 18:31:49 2017
@@ -21,6 +21,7 @@ package org.apache.axis2.handlers.addres
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMAttribute;
+import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMNamespace;
import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axiom.soap.SOAPEnvelope;
@@ -303,7 +304,7 @@ public class AddressingOutHandlerTest ex
assertEquals("http://whatever.org", defaultEnvelope.getHeader()
.getFirstChildWithName(Final.QNAME_WSA_TO).getText());
- Iterator iterator =
+ Iterator<OMElement> iterator =
defaultEnvelope.getHeader().getChildrenWithName(Final.QNAME_WSA_RELATES_TO);
int i = 0;
while (iterator.hasNext()) {
@@ -346,7 +347,7 @@ public class AddressingOutHandlerTest ex
assertEquals("http://whatever.org", defaultEnvelope.getHeader()
.getFirstChildWithName(Final.QNAME_WSA_TO).getText());
- Iterator iterator =
+ Iterator<OMElement> iterator =
defaultEnvelope.getHeader().getChildrenWithName(Final.QNAME_WSA_RELATES_TO);
int i = 0;
while (iterator.hasNext()) {
@@ -384,7 +385,7 @@ public class AddressingOutHandlerTest ex
assertEquals("http://oldEPR.org", defaultEnvelope.getHeader()
.getFirstChildWithName(Final.QNAME_WSA_TO).getText());
- Iterator iterator =
+ Iterator<OMElement> iterator =
defaultEnvelope.getHeader().getChildrenWithName(Final.QNAME_WSA_RELATES_TO);
int i = 0;
while (iterator.hasNext()) {
Modified: axis/axis2/java/core/branches/hermetic-tests/modules/codegen/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/codegen/pom.xml?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/codegen/pom.xml (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/codegen/pom.xml Sat Jul 1 18:31:49 2017
@@ -55,7 +55,7 @@
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
- <artifactId>jaxws-tools</artifactId>
+ <artifactId>jaxws-tools</artifactId>
<exclusions>
<exclusion>
<groupId>com.sun.xml.ws</groupId>
@@ -68,13 +68,13 @@
</exclusions>
</dependency>
<dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-xjc</artifactId>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-xjc</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
- <artifactId>jaxws-rt</artifactId>
+ <artifactId>jaxws-rt</artifactId>
<scope>test</scope>
</dependency>
<dependency>
@@ -82,11 +82,11 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>xmlunit</groupId>
- <artifactId>xmlunit</artifactId>
+ <dependency>
+ <groupId>xmlunit</groupId>
+ <artifactId>xmlunit</artifactId>
<scope>test</scope>
- </dependency>
+ </dependency>
</dependencies>
<url>http://axis.apache.org/axis2/java/core/</url>
<scm>
@@ -143,10 +143,10 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<inherited>true</inherited>
- <configuration>
+ <configuration>
<includes>
- <include>**/*Test.java</include>
- </includes>
+ <include>**/*Test.java</include>
+ </includes>
</configuration>
</plugin>
@@ -214,7 +214,7 @@
</goals>
<configuration>
<outputDirectory>${project.build.directory}/templates</outputDirectory>
- <resources>
+ <resources>
<resource>
<directory>../adb-codegen/src</directory>
<includes>
@@ -239,8 +239,8 @@
<include>**/*.xsl</include>
</includes>
</resource>
- </resources>
- </configuration>
+ </resources>
+ </configuration>
</execution>
</executions>
</plugin>
Modified: axis/axis2/java/core/branches/hermetic-tests/modules/corba/src/org/apache/axis2/corba/deployer/CorbaDeployer.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/corba/src/org/apache/axis2/corba/deployer/CorbaDeployer.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/corba/src/org/apache/axis2/corba/deployer/CorbaDeployer.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/corba/src/org/apache/axis2/corba/deployer/CorbaDeployer.java Sat Jul 1 18:31:49 2017
@@ -155,7 +155,7 @@ public class CorbaDeployer extends Abstr
throws DeploymentException {
try {
// Processing service level parameters
- Iterator itr = service_element.getChildrenWithName(new QName(TAG_PARAMETER));
+ Iterator<OMElement> itr = service_element.getChildrenWithName(new QName(TAG_PARAMETER));
processParameters(itr, service, service.getParent());
// process service description
@@ -242,9 +242,9 @@ public class CorbaDeployer extends Abstr
ArrayList excludeops = null;
if (excludeOperations != null) {
excludeops = new ArrayList();
- Iterator excludeOp_itr = excludeOperations.getChildrenWithName(new QName(TAG_OPERATION));
+ Iterator<OMElement> excludeOp_itr = excludeOperations.getChildrenWithName(new QName(TAG_OPERATION));
while (excludeOp_itr.hasNext()) {
- OMElement opName = (OMElement) excludeOp_itr.next();
+ OMElement opName = excludeOp_itr.next();
excludeops.add(opName.getText().trim());
}
}
@@ -253,9 +253,9 @@ public class CorbaDeployer extends Abstr
}
// processing service-wide modules which required to engage globally
- Iterator moduleRefs = service_element.getChildrenWithName(new QName(TAG_MODULE));
+ Iterator<OMElement> moduleRefs = service_element.getChildrenWithName(new QName(TAG_MODULE));
while (moduleRefs.hasNext()) {
- OMElement moduleref = (OMElement) moduleRefs.next();
+ OMElement moduleref = moduleRefs.next();
OMAttribute moduleRefAttribute = moduleref.getAttribute(new QName(TAG_REFERENCE));
String refName = moduleRefAttribute.getAttributeValue();
axisConfig.addGlobalModuleRef(refName);
@@ -287,10 +287,10 @@ public class CorbaDeployer extends Abstr
// processing transports
OMElement transports = service_element.getFirstChildWithName(new QName(TAG_TRANSPORTS));
if (transports != null) {
- Iterator transport_itr = transports.getChildrenWithName(new QName(TAG_TRANSPORT));
+ Iterator<OMElement> transport_itr = transports.getChildrenWithName(new QName(TAG_TRANSPORT));
ArrayList trs = new ArrayList();
while (transport_itr.hasNext()) {
- OMElement trsEle = (OMElement) transport_itr.next();
+ OMElement trsEle = transport_itr.next();
String tarnsportName = trsEle.getText().trim();
trs.add(tarnsportName);
}
@@ -333,9 +333,9 @@ public class CorbaDeployer extends Abstr
protected HashMap processMessageReceivers(ClassLoader loader, OMElement element) throws DeploymentException {
HashMap meps = new HashMap();
- Iterator iterator = element.getChildrenWithName(new QName(TAG_MESSAGE_RECEIVER));
+ Iterator<OMElement> iterator = element.getChildrenWithName(new QName(TAG_MESSAGE_RECEIVER));
while (iterator.hasNext()) {
- OMElement receiverElement = (OMElement) iterator.next();
+ OMElement receiverElement = iterator.next();
OMAttribute receiverName = receiverElement.getAttribute(new QName(TAG_CLASS_NAME));
String className = receiverName.getAttributeValue();
MessageReceiver receiver = loadMessageReceiver(loader, className);
Modified: axis/axis2/java/core/branches/hermetic-tests/modules/fastinfoset/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/fastinfoset/pom.xml?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/fastinfoset/pom.xml (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/fastinfoset/pom.xml Sat Jul 1 18:31:49 2017
@@ -77,10 +77,6 @@
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- </dependency>
- <dependency>
<groupId>org.apache.neethi</groupId>
<artifactId>neethi</artifactId>
</dependency>
Modified: axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/HandlerFailureTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/HandlerFailureTest.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/HandlerFailureTest.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/HandlerFailureTest.java Sat Jul 1 18:31:49 2017
@@ -20,7 +20,6 @@
package org.apache.axis2.engine;
import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.util.StAXUtils;
import org.apache.axis2.AxisFault;
import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.context.MessageContext;
@@ -69,7 +68,7 @@ public class HandlerFailureTest extends
ServiceClient sender = getClient(Echo.SERVICE_NAME, Echo.ECHO_OM_ELEMENT_OP_NAME);
OMElement result = sender.sendReceive(TestingUtils.createDummyOMElement());
- result.serializeAndConsume(StAXUtils.createXMLStreamWriter(System.out));
+ result.serializeAndConsume(System.out);
fail("the test must fail due to the intentional failure of the \"culprit\" handler");
} catch (AxisFault e) {
log.info(e.getMessage());
Modified: axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/ThreadingTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/ThreadingTest.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/ThreadingTest.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/ThreadingTest.java Sat Jul 1 18:31:49 2017
@@ -21,42 +21,73 @@ package org.apache.axis2.engine;
import junit.framework.Test;
import junit.framework.TestSuite;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.context.ServiceContext;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.description.AxisService;
-import org.apache.axis2.engine.util.InvokerThread;
import org.apache.axis2.engine.util.TestConstants;
+import org.apache.axis2.integration.TestingUtils;
import org.apache.axis2.integration.UtilServer;
import org.apache.axis2.integration.UtilServerBasedTestCase;
import org.apache.axis2.util.Utils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.xml.namespace.QName;
-import java.util.Calendar;
-import java.util.GregorianCalendar;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
public class ThreadingTest extends UtilServerBasedTestCase implements TestConstants {
-
-
private static final Log log = LogFactory.getLog(ThreadingTest.class);
- protected QName transportName = new QName("http://localhost/my",
- "NullTransport");
+ private static class Invoker implements Runnable {
+ private final int threadNumber;
+ private final CountDownLatch latch;
+ private Exception thrownException;
+
+ Invoker(int threadNumber, CountDownLatch latch) throws AxisFault {
+ this.threadNumber = threadNumber;
+ this.latch = latch;
+ }
- protected AxisConfiguration engineRegistry;
- protected MessageContext mc;
- protected ServiceContext serviceContext;
- protected AxisService service;
+ @Override
+ public void run() {
+ try {
+ log.info("Starting Thread number " + threadNumber + " .............");
+ OMElement payload = TestingUtils.createDummyOMElement();
+
+ Options options = new Options();
+ options.setTo(new EndpointReference("http://127.0.0.1:"
+ + UtilServer.TESTING_PORT
+ + "/axis2/services/EchoXMLService/echoOMElement"));
+ options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
+ ServiceClient sender = new ServiceClient();
+ sender.setOptions(options);
+ OMElement result = sender.sendReceive(payload);
+
+ TestingUtils.compareWithCreatedOMElement(result);
+ log.info("Finishing Thread number " + threadNumber + " .....");
+ } catch (Exception axisFault) {
+ thrownException = axisFault;
+ log.error("Error has occured invoking the service ", axisFault);
+ }
+ latch.countDown();
+ }
- protected boolean finish = false;
+ Exception getThrownException() {
+ return thrownException;
+ }
+ }
public static Test suite() {
return getTestSetup(new TestSuite(ThreadingTest.class));
}
protected void setUp() throws Exception {
- service =
+ AxisService service =
Utils.createSimpleService(serviceName,
Echo.class.getName(),
operationName);
@@ -69,41 +100,22 @@ public class ThreadingTest extends UtilS
}
public void testEchoXMLSync() throws Exception {
- int numberOfThreads = 5;
- InvokerThread[] invokerThreads = new InvokerThread[numberOfThreads];
+ Invoker[] invokers = new Invoker[5];
+ CountDownLatch latch = new CountDownLatch(invokers.length);
- for (int i = 0; i < numberOfThreads; i++) {
- InvokerThread invokerThread = new InvokerThread(i + 1);
- invokerThreads[i] = invokerThread;
- invokerThread.start();
+ for (int i = 0; i < invokers.length; i++) {
+ Invoker invoker = new Invoker(i + 1, latch);
+ invokers[i] = invoker;
+ new Thread(invoker).start();
}
- boolean threadsAreRunning;
- Calendar cal = new GregorianCalendar();
- int min = cal.get(Calendar.MINUTE);
-
- do {
- threadsAreRunning = false;
- for (int i = 0; i < numberOfThreads; i++) {
- if (invokerThreads[i].isAlive()) {
- threadsAreRunning = true;
- break;
- }
- Exception exception = invokerThreads[i].getThrownException();
- if (exception != null) {
- throw new Exception("Exception thrown in thread " + i + " ....", exception);
- }
- }
+ latch.await(30, TimeUnit.SECONDS);
- // waiting 3 seconds, if not finish, time out.
- if (Math.abs(min - new GregorianCalendar().get(Calendar.MINUTE)) > 1) {
- log.info("I'm timing out. Can't wait more than this to finish.");
- fail("Timing out");
+ for (Invoker invoker : invokers) {
+ Exception exception = invoker.getThrownException();
+ if (exception != null) {
+ throw exception;
}
-
- Thread.sleep(100);
- } while (threadsAreRunning);
-
- assertTrue(true);
+ }
}
}
Modified: axis/axis2/java/core/branches/hermetic-tests/modules/jaxws-integration/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/jaxws-integration/pom.xml?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/jaxws-integration/pom.xml (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/jaxws-integration/pom.xml Sat Jul 1 18:31:49 2017
@@ -187,12 +187,12 @@
<wsdlFile>test-resources/wsdl/echo.wsdl</wsdlFile>
<databindingName>adb</databindingName>
<generateServerSide>true</generateServerSide>
- <namespaceURIs>
- <namespaceURI>
+ <namespaceMappings>
+ <namespaceMapping>
<uri>http://test</uri>
<packageName>server</packageName>
- </namespaceURI>
- </namespaceURIs>
+ </namespaceMapping>
+ </namespaceMappings>
</configuration>
</execution>
</executions>
Modified: axis/axis2/java/core/branches/hermetic-tests/modules/jaxws-integration/test/org/apache/axis2/jaxws/dispatch/DOMSourceDispatchTests.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/jaxws-integration/test/org/apache/axis2/jaxws/dispatch/DOMSourceDispatchTests.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/jaxws-integration/test/org/apache/axis2/jaxws/dispatch/DOMSourceDispatchTests.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/jaxws-integration/test/org/apache/axis2/jaxws/dispatch/DOMSourceDispatchTests.java Sat Jul 1 18:31:49 2017
@@ -21,16 +21,15 @@ package org.apache.axis2.jaxws.dispatch;
import junit.framework.Test;
import junit.framework.TestSuite;
+
+import org.apache.axiom.om.OMXMLBuilderFactory;
import org.apache.axis2.jaxws.TestLogger;
import org.apache.axis2.jaxws.framework.AbstractTestCase;
-import org.apache.axis2.jaxws.message.util.Reader2Writer;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
import javax.xml.transform.Source;
import javax.xml.transform.dom.DOMSource;
import javax.xml.ws.Dispatch;
@@ -38,6 +37,7 @@ import javax.xml.ws.Response;
import javax.xml.ws.Service;
import javax.xml.ws.WebServiceException;
import java.io.ByteArrayInputStream;
+import java.io.StringWriter;
import java.util.concurrent.Future;
/**
@@ -45,9 +45,6 @@ import java.util.concurrent.Future;
* javax.xml.transform.dom.DOMSource
*/
public class DOMSourceDispatchTests extends AbstractTestCase{
-
- private static final XMLInputFactory inputFactory = XMLInputFactory.newInstance();
-
public static Test suite() {
return getTestSetup(new TestSuite(DOMSourceDispatchTests.class));
}
@@ -467,9 +464,8 @@ public class DOMSourceDispatchTests exte
* @return
*/
private String createStringFromSource(Source input) throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(input);
- Reader2Writer r2w = new Reader2Writer(reader);
- String text = r2w.getAsString();
- return text;
+ StringWriter sw = new StringWriter();
+ OMXMLBuilderFactory.createOMBuilder(input).getDocument().serializeAndConsume(sw);
+ return sw.toString();
}
}