cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r793059 - /cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/soap/SoapBindingSelectionTest.java
Date Fri, 10 Jul 2009 18:04:31 GMT
Author: dkulp
Date: Fri Jul 10 18:04:31 2009
New Revision: 793059

URL: http://svn.apache.org/viewvc?rev=793059&view=rev
Log:
[CXF-2336] Add asserts to check the namespace of return to test CXF-2336

Modified:
    cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/soap/SoapBindingSelectionTest.java

Modified: cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/soap/SoapBindingSelectionTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/soap/SoapBindingSelectionTest.java?rev=793059&r1=793058&r2=793059&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/soap/SoapBindingSelectionTest.java
(original)
+++ cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/soap/SoapBindingSelectionTest.java
Fri Jul 10 18:04:31 2009
@@ -18,6 +18,9 @@
  */
 package org.apache.cxf.frontend.soap;
 
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+
 import org.apache.cxf.binding.soap.Soap12;
 import org.apache.cxf.binding.soap.SoapBindingConfiguration;
 import org.apache.cxf.endpoint.ServerImpl;
@@ -78,17 +81,26 @@
         MultipleEndpointObserver meo = (MultipleEndpointObserver) mo;
         assertEquals(2, meo.getEndpoints().size());
         
-        invoke("http://localhost/Hello", LocalTransportFactory.TRANSPORT_ID, "soap11.xml");
+        Node nd = invoke("http://localhost/Hello", LocalTransportFactory.TRANSPORT_ID, "soap11.xml");
+        assertEquals("http://schemas.xmlsoap.org/soap/envelope/", getNs(nd));
         
         assertTrue(service1Invoked);
         assertFalse(service2Invoked);
         
         service1Invoked = false;
         
-        invoke("http://localhost/Hello", LocalTransportFactory.TRANSPORT_ID, "soap12.xml");
+        nd = invoke("http://localhost/Hello", LocalTransportFactory.TRANSPORT_ID, "soap12.xml");
+        assertEquals("http://www.w3.org/2003/05/soap-envelope", getNs(nd));
         
         assertFalse(service1Invoked);
         assertTrue(service2Invoked);
     }
+    
+    private String getNs(Node nd) {
+        if (nd instanceof Document) {
+            return getNs(((Document)nd).getDocumentElement());
+        }
+        return nd.getNamespaceURI();
+    }
 
 }



Mime
View raw message