cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1419367 - in /cxf/trunk/api/src: main/java/org/apache/cxf/staxutils/transform/ test/java/org/apache/cxf/staxutils/resources/ test/java/org/apache/cxf/staxutils/transform/
Date Mon, 10 Dec 2012 12:18:01 GMT
Author: ay
Date: Mon Dec 10 12:17:59 2012
New Revision: 1419367

URL: http://svn.apache.org/viewvc?rev=1419367&view=rev
Log:
[CXF-4689] stax outTransform feature may fail to remove the default namespace

Added:
    cxf/trunk/api/src/test/java/org/apache/cxf/staxutils/resources/greetMe2Req.xml   (with
props)
    cxf/trunk/api/src/test/java/org/apache/cxf/staxutils/resources/greetMe2ReqIn1.xml   (with
props)
Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/staxutils/transform/DelegatingNamespaceContext.java
    cxf/trunk/api/src/test/java/org/apache/cxf/staxutils/transform/OutTransformWriterTest.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/staxutils/transform/DelegatingNamespaceContext.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/staxutils/transform/DelegatingNamespaceContext.java?rev=1419367&r1=1419366&r2=1419367&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/staxutils/transform/DelegatingNamespaceContext.java
(original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/staxutils/transform/DelegatingNamespaceContext.java
Mon Dec 10 12:17:59 2012
@@ -82,7 +82,7 @@ class DelegatingNamespaceContext impleme
             }
         }
         String ns = nc.getNamespaceURI(prefix);
-        if (ns != null) {
+        if (ns != null && ns.length() > 0) {
             addPrefix(prefix, ns);
         }
         return ns;

Added: cxf/trunk/api/src/test/java/org/apache/cxf/staxutils/resources/greetMe2Req.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/test/java/org/apache/cxf/staxutils/resources/greetMe2Req.xml?rev=1419367&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cxf/trunk/api/src/test/java/org/apache/cxf/staxutils/resources/greetMe2Req.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: cxf/trunk/api/src/test/java/org/apache/cxf/staxutils/resources/greetMe2Req.xml
------------------------------------------------------------------------------
    svn:mime-type = txt/xml

Added: cxf/trunk/api/src/test/java/org/apache/cxf/staxutils/resources/greetMe2ReqIn1.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/test/java/org/apache/cxf/staxutils/resources/greetMe2ReqIn1.xml?rev=1419367&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cxf/trunk/api/src/test/java/org/apache/cxf/staxutils/resources/greetMe2ReqIn1.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: cxf/trunk/api/src/test/java/org/apache/cxf/staxutils/resources/greetMe2ReqIn1.xml
------------------------------------------------------------------------------
    svn:mime-type = txt/xml

Modified: cxf/trunk/api/src/test/java/org/apache/cxf/staxutils/transform/OutTransformWriterTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/test/java/org/apache/cxf/staxutils/transform/OutTransformWriterTest.java?rev=1419367&r1=1419366&r2=1419367&view=diff
==============================================================================
--- cxf/trunk/api/src/test/java/org/apache/cxf/staxutils/transform/OutTransformWriterTest.java
(original)
+++ cxf/trunk/api/src/test/java/org/apache/cxf/staxutils/transform/OutTransformWriterTest.java
Mon Dec 10 12:17:59 2012
@@ -300,6 +300,20 @@ public class OutTransformWriterTest exte
     }
     
     @Test
+    public void testRemoveOneDefaultNamespace() throws Exception {
+        Map<String, String> inMap = new HashMap<String, String>();
+        inMap.put("{http://cxf.apache.org/hello_world_soap_http/types2}requestType", "requestType");

+        XMLStreamReader reader = 
+            TransformTestUtils.createOutTransformedStreamReader("../resources/greetMe2ReqIn1.xml",

+                                                                inMap, null, null, null,
false, null);
+        
+        XMLStreamReader reader2 = 
+            StaxUtils.createXMLStreamReader(
+                InTransformReader.class.getResourceAsStream("../resources/greetMe2Req.xml"));
+        TransformTestUtils.verifyReaders(reader2, reader, true, true);
+    }
+
+    @Test
     public void testReadWithReplaceAppend() throws Exception {
         Map<String, String> transformElements = new HashMap<String, String>();
         transformElements.put("requestValue",



Mime
View raw message