Author: veithen
Date: Sat Sep 22 19:48:02 2012
New Revision: 1388878

URL: http://svn.apache.org/viewvc?rev=1388878&view=rev
Log:
Added an explicit test case for the split WSDL feature of the java2wsdl Ant 
task. Previously this was (partially) tested by test/wsdl/roundtrip.

Added:
    axis/axis1/java/trunk/axis-ant/src/test/ant/split/
    axis/axis1/java/trunk/axis-ant/src/test/ant/split/build.xml   (with props)
    axis/axis1/java/trunk/axis-ant/src/test/java/test/wsdl/split/
    
axis/axis1/java/trunk/axis-ant/src/test/java/test/wsdl/split/MyPortType.java   
(with props)
    
axis/axis1/java/trunk/axis-ant/src/test/java/test/wsdl/split/SplitTestCase.java 
  (with props)
Modified:
    axis/axis1/java/trunk/axis-ant/pom.xml
    axis/axis1/java/trunk/test/wsdl/roundtrip/build.xml

Modified: axis/axis1/java/trunk/axis-ant/pom.xml
URL: 
http://svn.apache.org/viewvc/axis/axis1/java/trunk/axis-ant/pom.xml?rev=1388878&r1=1388877&r2=1388878&view=diff
==============================================================================
--- axis/axis1/java/trunk/axis-ant/pom.xml (original)
+++ axis/axis1/java/trunk/axis-ant/pom.xml Sat Sep 22 19:48:02 2012
@@ -81,6 +81,7 @@
                                 <ant antfile="src/test/ant/literal/build.xml" 
target="test" inheritrefs="true" />
                                 <ant 
antfile="src/test/ant/multibinding/build.xml" target="test" inheritrefs="true" 
/>
                                 <ant antfile="src/test/ant/qname/build.xml" 
target="test" inheritrefs="true" />
+                                <ant antfile="src/test/ant/split/build.xml" 
target="test" inheritrefs="true" />
                             </target>
                         </configuration>
                     </execution>

Added: axis/axis1/java/trunk/axis-ant/src/test/ant/split/build.xml
URL: 
http://svn.apache.org/viewvc/axis/axis1/java/trunk/axis-ant/src/test/ant/split/build.xml?rev=1388878&view=auto
==============================================================================
--- axis/axis1/java/trunk/axis-ant/src/test/ant/split/build.xml (added)
+++ axis/axis1/java/trunk/axis-ant/src/test/ant/split/build.xml Sat Sep 22 
19:48:02 2012
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<!--
+  ~ 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>
+    <target name="test">
+        <mkdir dir="${project.build.directory}/work/test/wsdl/split"/>
+        
+        <!-- Tests whether the split wsdl function works. -->
+        <java2wsdl 
output="${project.build.directory}/work/test/wsdl/split/SplitTestIntf.wsdl"
+                   
outputImpl="${project.build.directory}/work/test/wsdl/split/SplitTestImpl.wsdl"
+                   className="test.wsdl.split.MyPortType"
+                   useInheritedMethods="false"
+                   namespace="http://split.wsdl.test";
+                   namespaceImpl="http://split.wsdl.test";
+                   typeMappingVersion="1.0"
+                   location="http://localhost:8080/axis/services/SplitTest";
+                   locationImport="SplitTestIntf.wsdl">
+            <classpath refid="maven.test.classpath"/>
+            <mapping namespace="http://split.wsdl.test"; 
package="test.wsdl.split"/>
+        </java2wsdl>
+    </target>
+</project>

Propchange: axis/axis1/java/trunk/axis-ant/src/test/ant/split/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
axis/axis1/java/trunk/axis-ant/src/test/java/test/wsdl/split/MyPortType.java
URL: 
http://svn.apache.org/viewvc/axis/axis1/java/trunk/axis-ant/src/test/java/test/wsdl/split/MyPortType.java?rev=1388878&view=auto
==============================================================================
--- 
axis/axis1/java/trunk/axis-ant/src/test/java/test/wsdl/split/MyPortType.java 
(added)
+++ 
axis/axis1/java/trunk/axis-ant/src/test/java/test/wsdl/split/MyPortType.java 
Sat Sep 22 19:48:02 2012
@@ -0,0 +1,23 @@
+/*
+ * 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 test.wsdl.split;
+
+public interface MyPortType {
+    String echo(String arg);
+}

Propchange: 
axis/axis1/java/trunk/axis-ant/src/test/java/test/wsdl/split/MyPortType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
axis/axis1/java/trunk/axis-ant/src/test/java/test/wsdl/split/SplitTestCase.java
URL: 
http://svn.apache.org/viewvc/axis/axis1/java/trunk/axis-ant/src/test/java/test/wsdl/split/SplitTestCase.java?rev=1388878&view=auto
==============================================================================
--- 
axis/axis1/java/trunk/axis-ant/src/test/java/test/wsdl/split/SplitTestCase.java 
(added)
+++ 
axis/axis1/java/trunk/axis-ant/src/test/java/test/wsdl/split/SplitTestCase.java 
Sat Sep 22 19:48:02 2012
@@ -0,0 +1,45 @@
+/*
+ * 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 test.wsdl.split;
+
+import java.io.File;
+
+import javax.wsdl.Binding;
+import javax.wsdl.Definition;
+import javax.wsdl.Port;
+import javax.wsdl.Service;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.namespace.QName;
+
+import junit.framework.TestCase;
+
+public class SplitTestCase extends TestCase {
+    public void testValidateWSDL() throws Exception {
+        WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
+        Definition definition = reader.readWSDL(new 
File(System.getProperty("basedir", ".")
+                + 
"/target/work/test/wsdl/split/SplitTestImpl.wsdl").toURI().toString());
+        Service service = definition.getService(new 
QName("http://split.wsdl.test";, "MyPortTypeService"));
+        Port port = service.getPort("SplitTest");
+        // This is the critical part: the binding is defined in the imported 
WSDL
+        Binding binding = port.getBinding();
+        assertNotNull(binding);
+        assertEquals("MyPortType", 
binding.getPortType().getQName().getLocalPart());
+    }
+}

Propchange: 
axis/axis1/java/trunk/axis-ant/src/test/java/test/wsdl/split/SplitTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: axis/axis1/java/trunk/test/wsdl/roundtrip/build.xml
URL: 
http://svn.apache.org/viewvc/axis/axis1/java/trunk/test/wsdl/roundtrip/build.xml?rev=1388878&r1=1388877&r2=1388878&view=diff
==============================================================================
--- axis/axis1/java/trunk/test/wsdl/roundtrip/build.xml (original)
+++ axis/axis1/java/trunk/test/wsdl/roundtrip/build.xml Sat Sep 22 19:48:02 2012
@@ -81,20 +81,6 @@ Copyright:
       <exclude name="test/wsdl/roundtrip/*TestCase.java" />
       <exclude name="test/wsdl/roundtrip/*Impl.java" />
     </javac>
-    <!-- The following invocation of java2wsdl simply tests whether the
-         split wsdl function works.  The generated wsdl files are not used. -->
-
-    <java2wsdl 
output="${axis.home}/build/work/test/wsdl/roundtrip/RoundtripIntf.wsdl"
-               
outputImpl="${axis.home}/build/work/test/wsdl/roundtrip/RoundtripImpl.wsdl"
-               className= "test.wsdl.roundtrip.RoundtripPortType"
-               useInheritedMethods="false"
-               namespace="http://roundtrip.wsdl.test";
-               namespaceImpl="http://roundtrip.wsdl.test";
-               typeMappingVersion="1.0"
-               location="http://localhost:8080/axis/services/RoundtripTest";
-               
locationImport="//build/work/test/wsdl/roundtrip/RoundtripIntf.wsdl">
-        <mapping namespace="http://roundtrip.wsdl.test"; 
package="test.wsdl.roundtrip"/>
-    </java2wsdl>
 
     <!-- Now create the real WSDL file -->
     <!-- The className must be the RoundtripPortType to properly test 
multi-inherits -->


Reply via email to