ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1527053 - in /webservices/neethi/trunk/src: main/java/org/apache/neethi/builders/converters/ test/java/org/apache/neethi/ test/test-resources/bugs/neethi15/input/
Date Fri, 27 Sep 2013 20:03:43 GMT
Author: dkulp
Date: Fri Sep 27 20:03:43 2013
New Revision: 1527053

URL: http://svn.apache.org/r1527053
Log:
[NEETHI-16] When reading from Stax, return the namespaces with the attributes to match what
DOM does and what is expected in the serialization.

Modified:
    webservices/neethi/trunk/src/main/java/org/apache/neethi/builders/converters/AbstractStaxConverter.java
    webservices/neethi/trunk/src/test/java/org/apache/neethi/BasicTestCases.java
    webservices/neethi/trunk/src/test/java/org/apache/neethi/IntersectTest.java
    webservices/neethi/trunk/src/test/test-resources/bugs/neethi15/input/Policy1.xml

Modified: webservices/neethi/trunk/src/main/java/org/apache/neethi/builders/converters/AbstractStaxConverter.java
URL: http://svn.apache.org/viewvc/webservices/neethi/trunk/src/main/java/org/apache/neethi/builders/converters/AbstractStaxConverter.java?rev=1527053&r1=1527052&r2=1527053&view=diff
==============================================================================
--- webservices/neethi/trunk/src/main/java/org/apache/neethi/builders/converters/AbstractStaxConverter.java
(original)
+++ webservices/neethi/trunk/src/main/java/org/apache/neethi/builders/converters/AbstractStaxConverter.java
Fri Sep 27 20:03:43 2013
@@ -23,6 +23,7 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 
+import javax.xml.XMLConstants;
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
@@ -49,6 +50,14 @@ public abstract class AbstractStaxConver
                              s.getAttributeLocalName(x)),
                    s.getAttributeValue(x));
         }
+        for (int x = 0; x < s.getNamespaceCount(); x++) {
+            String pfx = s.getNamespacePrefix(x);
+            if (pfx == null) {
+                mp.put(new QName(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, "xmlns"), s.getNamespaceURI(x));
+            } else {
+                mp.put(new QName(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, pfx, "xmlns"), s.getNamespaceURI(x));
+            }
+        }
         return mp;
     }
     public Iterator<XMLStreamReader> getChildren(final XMLStreamReader s) {

Modified: webservices/neethi/trunk/src/test/java/org/apache/neethi/BasicTestCases.java
URL: http://svn.apache.org/viewvc/webservices/neethi/trunk/src/test/java/org/apache/neethi/BasicTestCases.java?rev=1527053&r1=1527052&r2=1527053&view=diff
==============================================================================
--- webservices/neethi/trunk/src/test/java/org/apache/neethi/BasicTestCases.java (original)
+++ webservices/neethi/trunk/src/test/java/org/apache/neethi/BasicTestCases.java Fri Sep 27
20:03:43 2013
@@ -184,6 +184,8 @@ public class BasicTestCases extends Poli
             XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(sw);
             p.serialize(writer);
             writer.flush();
+            //System.out.println("\n  " + x);
+            //System.out.println(sw.toString());
             XMLStreamReader r = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(sw.toString()));
             while (r.hasNext()) {
                 r.next();

Modified: webservices/neethi/trunk/src/test/java/org/apache/neethi/IntersectTest.java
URL: http://svn.apache.org/viewvc/webservices/neethi/trunk/src/test/java/org/apache/neethi/IntersectTest.java?rev=1527053&r1=1527052&r2=1527053&view=diff
==============================================================================
--- webservices/neethi/trunk/src/test/java/org/apache/neethi/IntersectTest.java (original)
+++ webservices/neethi/trunk/src/test/java/org/apache/neethi/IntersectTest.java Fri Sep 27
20:03:43 2013
@@ -22,10 +22,8 @@ package org.apache.neethi;
 import java.io.File;
 import java.io.StringWriter;
 
-import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLOutputFactory;
 import javax.xml.stream.XMLStreamWriter;
-import javax.xml.transform.dom.DOMSource;
 
 import org.apache.neethi.util.PolicyComparator;
 

Modified: webservices/neethi/trunk/src/test/test-resources/bugs/neethi15/input/Policy1.xml
URL: http://svn.apache.org/viewvc/webservices/neethi/trunk/src/test/test-resources/bugs/neethi15/input/Policy1.xml?rev=1527053&r1=1527052&r2=1527053&view=diff
==============================================================================
--- webservices/neethi/trunk/src/test/test-resources/bugs/neethi15/input/Policy1.xml (original)
+++ webservices/neethi/trunk/src/test/test-resources/bugs/neethi15/input/Policy1.xml Fri Sep
27 20:03:43 2013
@@ -18,7 +18,8 @@
   -->
 <wsp:Policy
 xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
-xmlns:sp="http://schemas.xmlsoap.org/ws/2002/12/secext" >
+xmlns:sp="http://schemas.xmlsoap.org/ws/2002/12/secext"
+xmlns="http://example.com" >
   <wsp:ExactlyOne>
     <wsp:All>
       <sp:SecurityToken>



Mime
View raw message