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 2016/02/13 12:03:12 UTC
svn commit: r1730180 - in /axis/axis2/java/core/trunk: ./ modules/adb-tests/
modules/adb-tests/src/ modules/adb-tests/src/test/
modules/adb-tests/src/test/java/ modules/adb-tests/src/test/java/org/
modules/adb-tests/src/test/java/org/apache/ modules/ad...
Author: veithen
Date: Sat Feb 13 11:03:12 2016
New Revision: 1730180
URL: http://svn.apache.org/viewvc?rev=1730180&view=rev
Log:
Add a test case reproducing AXIS2-5694.
Added:
axis/axis2/java/core/trunk/modules/adb-tests/ (with props)
axis/axis2/java/core/trunk/modules/adb-tests/pom.xml (with props)
axis/axis2/java/core/trunk/modules/adb-tests/src/
axis/axis2/java/core/trunk/modules/adb-tests/src/test/
axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/
axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/
axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/
axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/
axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/
axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/mtom/
axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/mtom/MTOMTest.java (with props)
axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/mtom/service/
axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/mtom/service/MTOMServiceImpl.java (with props)
axis/axis2/java/core/trunk/modules/adb-tests/src/test/wsdl/
axis/axis2/java/core/trunk/modules/adb-tests/src/test/wsdl/MTOMService.wsdl
Modified:
axis/axis2/java/core/trunk/pom.xml
Propchange: axis/axis2/java/core/trunk/modules/adb-tests/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Feb 13 11:03:12 2016
@@ -0,0 +1,4 @@
+.classpath
+.project
+.settings
+target
Added: axis/axis2/java/core/trunk/modules/adb-tests/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb-tests/pom.xml?rev=1730180&view=auto
==============================================================================
--- axis/axis2/java/core/trunk/modules/adb-tests/pom.xml (added)
+++ axis/axis2/java/core/trunk/modules/adb-tests/pom.xml Sat Feb 13 11:03:12 2016
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2</artifactId>
+ <version>1.8.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>axis2-adb-tests</artifactId>
+ <name>Apache Axis2 - ADB Tests</name>
+ <description>ADB Tests</description>
+ <url>http://axis.apache.org/axis2/java/core/</url>
+ <scm>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/axis/axis2/java/core/trunk/modules/adb-tests</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/axis/axis2/java/core/trunk/modules/adb-tests</developerConnection>
+ <url>http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb-tests</url>
+ </scm>
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>axis2-adb</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>axis2-transport-local</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>axis2-transport-http</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ws.commons.axiom</groupId>
+ <artifactId>testutils</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.ws</groupId>
+ <artifactId>jaxws-rt</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>axis2-wsdl2code-maven-plugin</artifactId>
+ <version>${project.version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate-test-sources</goal>
+ </goals>
+ <configuration>
+ <wsdlFile>src/test/wsdl/MTOMService.wsdl</wsdlFile>
+ <databindingName>adb</databindingName>
+ <syncMode>sync</syncMode>
+ <packageName>org.apache.axis2.databinding.mtom.client</packageName>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jaxws-maven-plugin</artifactId>
+ <version>2.4.1</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>wsimport-test</goal>
+ </goals>
+ <configuration>
+ <wsdlFiles>
+ <wsdlFile>${basedir}/src/test/wsdl/MTOMService.wsdl</wsdlFile>
+ </wsdlFiles>
+ <packageName>org.apache.axis2.databinding.mtom.service</packageName>
+ </configuration>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.xml.ws</groupId>
+ <artifactId>jaxws-tools</artifactId>
+ <version>${jaxws.tools.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: axis/axis2/java/core/trunk/modules/adb-tests/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/mtom/MTOMTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/mtom/MTOMTest.java?rev=1730180&view=auto
==============================================================================
--- axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/mtom/MTOMTest.java (added)
+++ axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/mtom/MTOMTest.java Sat Feb 13 11:03:12 2016
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis2.databinding.mtom;
+
+import javax.activation.DataHandler;
+import javax.xml.ws.Endpoint;
+
+import org.apache.axiom.testutils.PortAllocator;
+import org.apache.axiom.testutils.activation.RandomDataSource;
+import org.apache.axiom.testutils.io.IOTestUtils;
+import org.apache.axis2.Constants;
+import org.apache.axis2.databinding.mtom.client.MTOMServiceStub;
+import org.apache.axis2.databinding.mtom.client.MTOMServiceStub.GetContent;
+import org.apache.axis2.databinding.mtom.service.MTOMServiceImpl;
+import org.junit.Ignore;
+import org.junit.Test;
+
+public class MTOMTest {
+ @Test
+ @Ignore("AXIS2-5694")
+ public void test() throws Exception {
+ int port = PortAllocator.allocatePort();
+ String address = "http://localhost:" + port + "/mtom";
+ Endpoint endpoint = Endpoint.publish(address, new MTOMServiceImpl());
+ try {
+ MTOMServiceStub stub = new MTOMServiceStub(address);
+ // JAX-WS only produces an MTOM response if the request uses MTOM
+ stub._getServiceClient().getOptions().setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
+ DataHandler content = stub.getContent(new GetContent()).getContent();
+ IOTestUtils.compareStreams(
+ new RandomDataSource(654321L, 1000000).getInputStream(), "expected",
+ content.getInputStream(), "actual");
+ } finally {
+ endpoint.stop();
+ }
+ }
+}
Propchange: axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/mtom/MTOMTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/mtom/service/MTOMServiceImpl.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/mtom/service/MTOMServiceImpl.java?rev=1730180&view=auto
==============================================================================
--- axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/mtom/service/MTOMServiceImpl.java (added)
+++ axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/mtom/service/MTOMServiceImpl.java Sat Feb 13 11:03:12 2016
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis2.databinding.mtom.service;
+
+import javax.activation.DataHandler;
+import javax.jws.WebService;
+import javax.xml.ws.soap.MTOM;
+
+import org.apache.axiom.testutils.activation.RandomDataSource;
+
+@WebService(endpointInterface="org.apache.axis2.databinding.mtom.service.MTOMService")
+@MTOM
+public class MTOMServiceImpl implements MTOMService {
+ @Override
+ public DataHandler getContent() {
+ return new DataHandler(new RandomDataSource(654321L, 1000000));
+ }
+}
Propchange: axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/mtom/service/MTOMServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: axis/axis2/java/core/trunk/modules/adb-tests/src/test/wsdl/MTOMService.wsdl
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb-tests/src/test/wsdl/MTOMService.wsdl?rev=1730180&view=auto
==============================================================================
--- axis/axis2/java/core/trunk/modules/adb-tests/src/test/wsdl/MTOMService.wsdl (added)
+++ axis/axis2/java/core/trunk/modules/adb-tests/src/test/wsdl/MTOMService.wsdl Sat Feb 13 11:03:12 2016
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://apache.org/axis2/mtom" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="MTOMService" targetNamespace="http://apache.org/axis2/mtom">
+ <wsdl:types>
+ <xsd:schema targetNamespace="http://apache.org/axis2/mtom" xmlns:xmime="http://www.w3.org/2005/05/xmlmime">
+ <xsd:element name="GetContent">
+ <xsd:complexType>
+ <xsd:sequence/>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="GetContentResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="content" type="xsd:base64Binary" xmime:expectedContentTypes="application/octet-stream"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="GetContentRequest">
+ <wsdl:part element="tns:GetContent" name="parameters"/>
+ </wsdl:message>
+ <wsdl:message name="GetContentResponse">
+ <wsdl:part element="tns:GetContentResponse" name="parameters"/>
+ </wsdl:message>
+ <wsdl:portType name="MTOMService">
+ <wsdl:operation name="GetContent">
+ <wsdl:input message="tns:GetContentRequest"/>
+ <wsdl:output message="tns:GetContentResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="MTOMServiceSOAP" type="tns:MTOMService">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="GetContent">
+ <soap:operation soapAction="http://apache.org/axis2/mtom/GetContent"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="MTOMService">
+ <wsdl:port binding="tns:MTOMServiceSOAP" name="MTOMServiceSOAP">
+ <soap:address location="http://localhost:8080/mtom"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
Modified: axis/axis2/java/core/trunk/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/pom.xml?rev=1730180&r1=1730179&r2=1730180&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/pom.xml (original)
+++ axis/axis2/java/core/trunk/pom.xml Sat Feb 13 11:03:12 2016
@@ -42,6 +42,7 @@
<module>apidocs</module>
<module>modules/adb</module>
<module>modules/adb-codegen</module>
+ <module>modules/adb-tests</module>
<module>modules/addressing</module>
<module>modules/codegen</module>
<module>modules/fastinfoset</module>