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 2018/10/28 17:44:11 UTC

svn commit: r1845049 - in /axis/axis2/java/core/trunk: code-coverage/ modules/samples/jaxws-interop/ modules/samples/jaxws-interop/src/main/resources/META-INF/ modules/samples/jaxws-interop/src/test/ modules/samples/jaxws-interop/src/test/java/ modules...

Author: veithen
Date: Sun Oct 28 17:44:10 2018
New Revision: 1845049

URL: http://svn.apache.org/viewvc?rev=1845049&view=rev
Log:
Add tests to jaxws-interop.

Added:
    axis/axis2/java/core/trunk/modules/samples/jaxws-interop/src/test/
    axis/axis2/java/core/trunk/modules/samples/jaxws-interop/src/test/java/
    axis/axis2/java/core/trunk/modules/samples/jaxws-interop/src/test/java/org/
    axis/axis2/java/core/trunk/modules/samples/jaxws-interop/src/test/java/org/apache/
    axis/axis2/java/core/trunk/modules/samples/jaxws-interop/src/test/java/org/apache/axis2/
    axis/axis2/java/core/trunk/modules/samples/jaxws-interop/src/test/java/org/apache/axis2/jaxws/
    axis/axis2/java/core/trunk/modules/samples/jaxws-interop/src/test/java/org/apache/axis2/jaxws/interop/
    axis/axis2/java/core/trunk/modules/samples/jaxws-interop/src/test/java/org/apache/axis2/jaxws/interop/InteropSampleTest.java   (with props)
Modified:
    axis/axis2/java/core/trunk/code-coverage/pom.xml
    axis/axis2/java/core/trunk/modules/samples/jaxws-interop/pom.xml
    axis/axis2/java/core/trunk/modules/samples/jaxws-interop/src/main/resources/META-INF/xsd1.xsd
    axis/axis2/java/core/trunk/modules/samples/jaxws-interop/src/main/resources/META-INF/xsd2.xsd

Modified: axis/axis2/java/core/trunk/code-coverage/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/code-coverage/pom.xml?rev=1845049&r1=1845048&r2=1845049&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/code-coverage/pom.xml (original)
+++ axis/axis2/java/core/trunk/code-coverage/pom.xml Sun Oct 28 17:44:10 2018
@@ -177,6 +177,12 @@
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.axis2.examples</groupId>
+            <artifactId>jaxws-interop</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
     <build>
         <plugins>

Modified: axis/axis2/java/core/trunk/modules/samples/jaxws-interop/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/samples/jaxws-interop/pom.xml?rev=1845049&r1=1845048&r2=1845049&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/samples/jaxws-interop/pom.xml (original)
+++ axis/axis2/java/core/trunk/modules/samples/jaxws-interop/pom.xml Sun Oct 28 17:44:10 2018
@@ -44,5 +44,62 @@
             <artifactId>axis2-jaxws</artifactId>
             <version>1.8.0-SNAPSHOT</version>
         </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.google.truth</groupId>
+            <artifactId>truth</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-testutils</artifactId>
+            <version>1.8.0-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-transport-http</artifactId>
+            <version>1.8.0-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.axis2</groupId>
+                <artifactId>axis2-repo-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>create-test-repository</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${project.build.directory}/repo</outputDirectory>
+                            <generatedAxis2xml>
+                                <deployers>
+                                    <deployer>
+                                        <extension>jar</extension>
+                                        <directory>servicejars</directory>
+                                        <className>org.apache.axis2.jaxws.framework.JAXWSDeployer</className>
+                                    </deployer>
+                                </deployers>
+                            </generatedAxis2xml>
+                            <jaxwsServices>
+                                <jaxwsService>
+                                    <name>InteropSample</name>
+                                    <packages>
+                                        <package>org.apache.axis2.jaxws.interop</package>
+                                    </packages>
+                                </jaxwsService>
+                            </jaxwsServices>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
 </project>

Modified: axis/axis2/java/core/trunk/modules/samples/jaxws-interop/src/main/resources/META-INF/xsd1.xsd
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/samples/jaxws-interop/src/main/resources/META-INF/xsd1.xsd?rev=1845049&r1=1845048&r2=1845049&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/samples/jaxws-interop/src/main/resources/META-INF/xsd1.xsd (original)
+++ axis/axis2/java/core/trunk/modules/samples/jaxws-interop/src/main/resources/META-INF/xsd1.xsd Sun Oct 28 17:44:10 2018
@@ -2,10 +2,10 @@
 <xs:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/"
            xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://tempuri.org/">
     <xs:import
-            schemaLocation="http://131.107.72.15/SoapWsdl_BaseDataTypes_XmlFormatter_Service_Indigo/BaseDataTypesDocLitB.svc?xsd=xsd0"
+            schemaLocation="xsd0.xsd"
             namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
     <xs:import
-            schemaLocation="http://131.107.72.15/SoapWsdl_BaseDataTypes_XmlFormatter_Service_Indigo/BaseDataTypesDocLitB.svc?xsd=xsd2"
+            schemaLocation="xsd2.xsd"
             namespace="http://schemas.datacontract.org/2004/07/System"/>
     <xs:element name="inBool" type="xs:boolean"/>
     <xs:element name="RetBoolResult" type="xs:boolean"/>

Modified: axis/axis2/java/core/trunk/modules/samples/jaxws-interop/src/main/resources/META-INF/xsd2.xsd
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/samples/jaxws-interop/src/main/resources/META-INF/xsd2.xsd?rev=1845049&r1=1845048&r2=1845049&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/samples/jaxws-interop/src/main/resources/META-INF/xsd2.xsd (original)
+++ axis/axis2/java/core/trunk/modules/samples/jaxws-interop/src/main/resources/META-INF/xsd2.xsd Sun Oct 28 17:44:10 2018
@@ -2,7 +2,7 @@
 <xs:schema elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/System"
            xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.datacontract.org/2004/07/System">
     <xs:import
-            schemaLocation="http://131.107.72.15/SoapWsdl_BaseDataTypes_XmlFormatter_Service_Indigo/BaseDataTypesDocLitB.svc?xsd=xsd0"
+            schemaLocation="xsd0.xsd"
             namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
     <xs:complexType name="DateTimeOffset">
         <xs:annotation>

Added: axis/axis2/java/core/trunk/modules/samples/jaxws-interop/src/test/java/org/apache/axis2/jaxws/interop/InteropSampleTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/samples/jaxws-interop/src/test/java/org/apache/axis2/jaxws/interop/InteropSampleTest.java?rev=1845049&view=auto
==============================================================================
--- axis/axis2/java/core/trunk/modules/samples/jaxws-interop/src/test/java/org/apache/axis2/jaxws/interop/InteropSampleTest.java (added)
+++ axis/axis2/java/core/trunk/modules/samples/jaxws-interop/src/test/java/org/apache/axis2/jaxws/interop/InteropSampleTest.java Sun Oct 28 17:44:10 2018
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis2.jaxws.interop;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+
+import org.apache.axis2.jaxws.ClientConfigurationFactory;
+import org.apache.axis2.metadata.registry.MetadataFactoryRegistry;
+import org.apache.axis2.testutils.Axis2Server;
+import org.junit.Rule;
+import org.junit.Test;
+import org.tempuri.BaseDataTypesDocLitBService;
+import org.tempuri.IBaseDataTypesDocLitB;
+
+public class InteropSampleTest {
+    @Rule
+    public final Axis2Server server = new Axis2Server("target/repo");
+
+    @Test
+    public void test() throws Exception {
+        MetadataFactoryRegistry.setFactory(ClientConfigurationFactory.class, new ClientConfigurationFactory(null, "target/repo/axis2.xml"));
+        BaseDataTypesDocLitBService service = new BaseDataTypesDocLitBService(
+                InteropSampleTest.class.getResource("/META-INF/BaseDataTypesDocLitB.wsdl"),
+                new QName("http://tempuri.org/", "BaseDataTypesDocLitBService"));
+        IBaseDataTypesDocLitB proxy = service.getBasicHttpBindingIBaseDataTypesDocLitB();
+        ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, server.getEndpoint("BaseDataTypesDocLitBService"));
+        assertThat(proxy.retBool(true)).isTrue();
+        assertThat(proxy.retInt(42)).isEqualTo(42);
+        String testString = "This is a test";
+        assertThat(proxy.retString(testString)).isEqualTo(testString);
+    }
+}

Propchange: axis/axis2/java/core/trunk/modules/samples/jaxws-interop/src/test/java/org/apache/axis2/jaxws/interop/InteropSampleTest.java
------------------------------------------------------------------------------
    svn:eol-style = native