cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ajaypai...@apache.org
Subject svn commit: r537893 - /incubator/cxf/branches/headerwork/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptorTest.java
Date Mon, 14 May 2007 15:55:39 GMT
Author: ajaypaibir
Date: Mon May 14 08:55:38 2007
New Revision: 537893

URL: http://svn.apache.org/viewvc?view=rev&rev=537893
Log:
Applying another patch from ulhas related to header work.

Modified:
    incubator/cxf/branches/headerwork/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptorTest.java

Modified: incubator/cxf/branches/headerwork/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/headerwork/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptorTest.java?view=diff&rev=537893&r1=537892&r2=537893
==============================================================================
--- incubator/cxf/branches/headerwork/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptorTest.java
(original)
+++ incubator/cxf/branches/headerwork/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptorTest.java
Mon May 14 08:55:38 2007
@@ -194,8 +194,7 @@
                         // change mustUnderstand to false
                         SOAPMessage message = smc.getMessage();
                         SOAPHeader soapHeader = message.getSOAPHeader();
-                        Iterator it = soapHeader.getChildElements();
-                        SOAPHeaderElement headerElementNew = (SOAPHeaderElement)it.next();
+                        Element headerElementNew = (Element)soapHeader.getChildNodes().item(0);
 
                         SoapVersion soapVersion = Soap11.getInstance();
                         headerElementNew.setAttributeNS(soapVersion.getNamespace(),
@@ -237,14 +236,8 @@
         
         Node node = ((Element) headerInfo[1]).getChildNodes().item(0);
         
-        Header hdr = new Header(new QName(node.getNamespaceURI(), node.getLocalName()), node);
-//        List<Header> hdrList = new ArrayList<Header>();
-        List<Header> oldList = message.getHeaders();
-//        oldList = hdrList;
-        oldList.add(hdr);
+        message.getHeaders().add(new Header(new QName(node.getNamespaceURI(), node.getLocalName()),
node));
         
-//        message.setHeaders(Element.class, (Element) headerInfo[1]);
-//        message.setContent(Node.class, (Document) headerInfo[0]);
         control.replay();
 
         SOAPHandlerInterceptor li = new SOAPHandlerInterceptor(binding);
@@ -253,9 +246,10 @@
 
         // Verify SOAPMessage header
         SOAPMessage soapMessageNew = message.getContent(SOAPMessage.class);
-        SOAPHeader soapHeader = soapMessageNew.getSOAPHeader();
-        Iterator itNew = soapHeader.getChildElements();
-        SOAPHeaderElement headerElementNew = (SOAPHeaderElement)itNew.next();
+        NodeList headerEls = soapMessageNew.getSOAPHeader().getChildNodes();
+
+        Element headerElementNew = (Element)headerEls.item(0);
+        
         SoapVersion soapVersion = Soap11.getInstance();
         assertEquals("false", headerElementNew.getAttributeNS(soapVersion.getNamespace(),
"mustUnderstand"));
 
@@ -265,8 +259,7 @@
         assertEquals("sendReceiveData", qn.getLocalPart());
         
         // Verify Header Element
-        List<Header> header = message.getHeaders();
-        Iterator<Header> iter = header.iterator();
+        Iterator<Header> iter = message.getHeaders().iterator();
         Element requiredHeader = null;
         while (iter.hasNext()) {
             Header localHdr = iter.next();
@@ -282,12 +275,6 @@
         
         assertNotNull("Should have found header1", requiredHeader);
         assertEquals("false", requiredHeader.getAttributeNS(soapVersion.getNamespace(), "mustUnderstand"));
-//        Element element = message.getHeaders(Element.class);      
-//        NodeList headerNodeList = element.getElementsByTagNameNS(
-//            "http://apache.org/hello_world_rpclit/types", "header1");
-//        Element headerElementNew1 = (Element)headerNodeList.item(0);
-//        assertEquals("false", headerElementNew1.getAttributeNS(
-//        soapVersion.getNamespace(), "mustUnderstand"));
     }
 
     public void testChangeSOAPHeaderOutBound() throws Exception {



Mime
View raw message