cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r531855 - in /incubator/cxf/trunk/tools: common/src/main/java/org/apache/cxf/tools/common/model/ wsdlto/test/ wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/ wsdlto/test/src/test/resources/wsdl2java_wsdl/
Date Tue, 24 Apr 2007 09:55:53 GMT
Author: mmao
Date: Tue Apr 24 02:55:52 2007
New Revision: 531855

URL: http://svn.apache.org/viewvc?view=rev&rev=531855
Log:
Add a test show how to get the address from JavaPort

Modified:
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaServiceClass.java
    incubator/cxf/trunk/tools/wsdlto/test/pom.xml
    incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/JAXWSContainerTest.java
    incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/router.wsdl

Modified: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaServiceClass.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaServiceClass.java?view=diff&rev=531855&r1=531854&r2=531855
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaServiceClass.java
(original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaServiceClass.java
Tue Apr 24 02:55:52 2007
@@ -36,7 +36,7 @@
         ports.add(port);
     }
 
-    public List getPorts() {
+    public List<JavaPort> getPorts() {
         return ports;
     }
     

Modified: incubator/cxf/trunk/tools/wsdlto/test/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/pom.xml?view=diff&rev=531855&r1=531854&r2=531855
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/test/pom.xml (original)
+++ incubator/cxf/trunk/tools/wsdlto/test/pom.xml Tue Apr 24 02:55:52 2007
@@ -63,6 +63,13 @@
         </dependency>
         
         <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-bindings-soap</artifactId>
+            <version>${project.version}</version>
+	    <scope>test</scope>
+        </dependency>
+
+        <dependency>
 	     <groupId>org.mortbay.jetty</groupId>
 	     <artifactId>jetty</artifactId>
 	     <version>6.1.2rc0</version>

Modified: incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/JAXWSContainerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/JAXWSContainerTest.java?view=diff&rev=531855&r1=531854&r2=531855
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/JAXWSContainerTest.java
(original)
+++ incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/JAXWSContainerTest.java
Tue Apr 24 02:55:52 2007
@@ -32,6 +32,8 @@
 import org.apache.cxf.tools.common.model.JavaInterface;
 import org.apache.cxf.tools.common.model.JavaMethod;
 import org.apache.cxf.tools.common.model.JavaModel;
+import org.apache.cxf.tools.common.model.JavaPort;
+import org.apache.cxf.tools.common.model.JavaServiceClass;
 import org.apache.cxf.tools.wsdlto.core.DataBindingProfile;
 import org.apache.cxf.tools.wsdlto.core.FrontEndProfile;
 import org.apache.cxf.tools.wsdlto.core.PluginLoader;
@@ -149,8 +151,9 @@
             assertEquals(1, interfaces.size());
 
             JavaInterface intf = interfaces.values().iterator().next();
+            String interfaceName = intf.getName();
+            assertEquals("Greeter", interfaceName);
             assertEquals("http://apache.org/hello_world_soap_http", intf.getNamespace());
-            assertEquals("Greeter", intf.getName());
             assertEquals("org.apache.hello_world_soap_http", intf.getPackageName());
 
             List<JavaMethod> methods = intf.getMethods();
@@ -161,6 +164,22 @@
             assertEquals(2, m1.getExceptions().size());
             assertEquals("BadRecordLitFault", m1.getExceptions().get(0).getName());
             assertEquals("NoSuchCodeLitFault", m1.getExceptions().get(1).getName());
+
+            String address = null;
+
+            for (JavaServiceClass service : javaModel.getServiceClasses().values()) {
+                List<JavaPort> ports = (List<JavaPort>) service.getPorts();
+                for (JavaPort port : ports) {
+                    if (interfaceName.equals(port.getPortType())) {
+                        address = port.getBindingAdress();
+                        break;
+                    }
+                }
+                if (!"".equals(address)) {
+                    break;
+                }
+            }
+            assertEquals("http://localhost:9000/SoapContext/SoapPort", address);
         } catch (Exception e) {
             e.printStackTrace();
         }

Modified: incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/router.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/router.wsdl?view=diff&rev=531855&r1=531854&r2=531855
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/router.wsdl (original)
+++ incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/router.wsdl Tue
Apr 24 02:55:52 2007
@@ -17,7 +17,7 @@
   specific language governing permissions and limitations
   under the License.
 -->
-<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://cxf.apache.org/routing/configuration"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://apache.org/HWRouter"
xmlns:tns1="http://apache.org/hello_world_doc_lit" targetNamespace="http://apache.org/HWRouter"
name="HWRouter">
+<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:ns1="http://cxf.apache.org/routing/configuration" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://apache.org/HWRouter" xmlns:tns1="http://apache.org/hello_world_doc_lit"
targetNamespace="http://apache.org/HWRouter" name="HWRouter">
 	<import namespace="http://apache.org/hello_world_doc_lit" location="./hello_world_doc_lit_router.wsdl"/>
 	<service name="HTTPSoapServiceSource">
 		<port name="HTTPSoapPortSource" binding="tns1:Greeter_SOAPBinding">
@@ -31,7 +31,7 @@
 	</service>
 	<service name="HTTPXMLServiceSource">
 		<port name="HTTPXMLPortSource" binding="tns1:Greeter_XMLBinding">
-			<soap:address location="http://localhost:9003"/>
+		    <http:address location="http://localhost:9003"/>
 		</port>
 	</service>
 	<ns1:route name="route_0">



Mime
View raw message