cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1295719 - in /cxf/branches/2.5.x-fixes: ./ common/common/src/main/java/org/apache/cxf/staxutils/transform/ common/common/src/test/java/org/apache/cxf/staxutils/resources/ common/common/src/test/java/org/apache/cxf/staxutils/transform/
Date Thu, 01 Mar 2012 18:13:14 GMT
Author: ay
Date: Thu Mar  1 18:13:14 2012
New Revision: 1295719

URL: http://svn.apache.org/viewvc?rev=1295719&view=rev
Log:
Merged revisions 1295714 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1295714 | ay | 2012-03-01 18:58:19 +0100 (Thu, 01 Mar 2012) | 1 line
  
  [CXF-4150] Transform feature's OutTransformWriter may not correctly generate namespace declarations
........

Added:
    cxf/branches/2.5.x-fixes/common/common/src/test/java/org/apache/cxf/staxutils/resources/wstrustReqSTRC.xml
  (with props)
    cxf/branches/2.5.x-fixes/common/common/src/test/java/org/apache/cxf/staxutils/resources/wstrustReqSTRCIn1.xml
  (with props)
Modified:
    cxf/branches/2.5.x-fixes/   (props changed)
    cxf/branches/2.5.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/transform/OutTransformWriter.java
    cxf/branches/2.5.x-fixes/common/common/src/test/java/org/apache/cxf/staxutils/transform/InTransformReaderTest.java
    cxf/branches/2.5.x-fixes/common/common/src/test/java/org/apache/cxf/staxutils/transform/OutTransformWriterTest.java

Propchange: cxf/branches/2.5.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar  1 18:13:14 2012
@@ -1 +1 @@
-/cxf/trunk:1295026,1295466,1295504
+/cxf/trunk:1295026,1295466,1295504,1295714

Propchange: cxf/branches/2.5.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.5.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/transform/OutTransformWriter.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/transform/OutTransformWriter.java?rev=1295719&r1=1295718&r2=1295719&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/transform/OutTransformWriter.java
(original)
+++ cxf/branches/2.5.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/transform/OutTransformWriter.java
Thu Mar  1 18:13:14 2012
@@ -20,8 +20,6 @@ package org.apache.cxf.staxutils.transfo
 
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -43,7 +41,6 @@ public class OutTransformWriter extends 
     private QNamesMap attributesMap;
     private Map<QName, ElementProperty> appendMap = new HashMap<QName, ElementProperty>(5);
     private Map<String, String> nsMap = new HashMap<String, String>(5);
-    private List<Set<String>> writtenUris = new LinkedList<Set<String>>();
     
     private Set<QName> dropElements;
     private Stack<List<ParsingEvent>> pushedAheadEvents = new Stack<List<ParsingEvent>>();
@@ -96,7 +93,7 @@ public class OutTransformWriter extends 
         
         uri = value != null ? value : uri;
         
-        if (writtenUris.get(0).contains(uri)) {
+        if (prefix.equals(getPrefix(uri))) {
             return;
         }
         
@@ -108,7 +105,6 @@ public class OutTransformWriter extends 
             }
             super.writeNamespace(prefix, uri);
         }
-        writtenUris.get(0).add(uri);
     }
     
     @Override
@@ -117,13 +113,6 @@ public class OutTransformWriter extends 
         if (matchesDropped(false)) {
             return;
         }
-        Set<String> s;
-        if (writtenUris.isEmpty()) {
-            s = new HashSet<String>();
-        } else {
-            s = new HashSet<String>(writtenUris.get(0));
-        }
-        writtenUris.add(0, s);
         
         final QName theName = new QName(uri, local, prefix);
         final ElementProperty appendProp = appendMap.remove(theName);
@@ -243,9 +232,7 @@ public class OutTransformWriter extends 
         } else if (dropDepth > 0) {
             dropDepth = 0;
         }
-        if (!writtenUris.isEmpty()) {
-            writtenUris.remove(0);
-        }
+
         QName theName = elementsStack.pop();
         final boolean dropped = dropElements.contains(theName);
         if (!dropped) {

Added: cxf/branches/2.5.x-fixes/common/common/src/test/java/org/apache/cxf/staxutils/resources/wstrustReqSTRC.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/common/common/src/test/java/org/apache/cxf/staxutils/resources/wstrustReqSTRC.xml?rev=1295719&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cxf/branches/2.5.x-fixes/common/common/src/test/java/org/apache/cxf/staxutils/resources/wstrustReqSTRC.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: cxf/branches/2.5.x-fixes/common/common/src/test/java/org/apache/cxf/staxutils/resources/wstrustReqSTRC.xml
------------------------------------------------------------------------------
    svn:mime-type = application/xml

Added: cxf/branches/2.5.x-fixes/common/common/src/test/java/org/apache/cxf/staxutils/resources/wstrustReqSTRCIn1.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/common/common/src/test/java/org/apache/cxf/staxutils/resources/wstrustReqSTRCIn1.xml?rev=1295719&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cxf/branches/2.5.x-fixes/common/common/src/test/java/org/apache/cxf/staxutils/resources/wstrustReqSTRCIn1.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: cxf/branches/2.5.x-fixes/common/common/src/test/java/org/apache/cxf/staxutils/resources/wstrustReqSTRCIn1.xml
------------------------------------------------------------------------------
    svn:mime-type = application/xml

Modified: cxf/branches/2.5.x-fixes/common/common/src/test/java/org/apache/cxf/staxutils/transform/InTransformReaderTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/common/common/src/test/java/org/apache/cxf/staxutils/transform/InTransformReaderTest.java?rev=1295719&r1=1295718&r2=1295719&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/common/common/src/test/java/org/apache/cxf/staxutils/transform/InTransformReaderTest.java
(original)
+++ cxf/branches/2.5.x-fixes/common/common/src/test/java/org/apache/cxf/staxutils/transform/InTransformReaderTest.java
Thu Mar  1 18:13:14 2012
@@ -424,4 +424,18 @@ public class InTransformReaderTest exten
         
     }
 
+    @Test
+    public void testOldSTSTransform() throws Exception {
+        Map<String, String> transformElements = new HashMap<String, String>();
+
+        transformElements.put("{http://docs.oasis-open.org/ws-sx/ws-trust/200512}*",
+                              "{http://schemas.xmlsoap.org/ws/2005/02/trust}*");
+        
+
+        TransformTestUtils.transformInStreamAndCompare("../resources/wstrustReqSTRCIn1.xml",

+                                                     "../resources/wstrustReqSTRC.xml",
+                                  transformElements, null, null, null, null);
+        
+    }
+
 }

Modified: cxf/branches/2.5.x-fixes/common/common/src/test/java/org/apache/cxf/staxutils/transform/OutTransformWriterTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/common/common/src/test/java/org/apache/cxf/staxutils/transform/OutTransformWriterTest.java?rev=1295719&r1=1295718&r2=1295719&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/common/common/src/test/java/org/apache/cxf/staxutils/transform/OutTransformWriterTest.java
(original)
+++ cxf/branches/2.5.x-fixes/common/common/src/test/java/org/apache/cxf/staxutils/transform/OutTransformWriterTest.java
Thu Mar  1 18:13:14 2012
@@ -396,4 +396,14 @@ public class OutTransformWriterTest exte
         
     }
     
+    @Test
+    public void testOldSTSTransform() throws Exception {
+        Map<String, String> transformElements = new HashMap<String, String>();
+        transformElements.put("{http://docs.oasis-open.org/ws-sx/ws-trust/200512}*",
+                              "{http://schemas.xmlsoap.org/ws/2005/02/trust}*");
+
+        TransformTestUtils.transformOutStreamAndCompare("../resources/wstrustReqSTRCIn1.xml",

+                                                     "../resources/wstrustReqSTRC.xml",
+                                  transformElements, null, null, null, null);
+    }
 }



Mime
View raw message