cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1512288 - in /cxf/branches/2.6.x-fixes: ./ api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java api/src/test/java/org/apache/cxf/staxutils/StaxUtilsTest.java
Date Fri, 09 Aug 2013 12:46:14 GMT
Author: ay
Date: Fri Aug  9 12:46:14 2013
New Revision: 1512288

URL: http://svn.apache.org/r1512288
Log:
Merged revisions 1512286 via  svn merge from
https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes

........
  r1512286 | ay | 2013-08-09 14:43:29 +0200 (Fri, 09 Aug 2013) | 9 lines
  
  Merged revisions 1511946 via  svn merge from
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r1511946 | ay | 2013-08-08 20:53:11 +0200 (Thu, 08 Aug 2013) | 1 line
    
    [CXF-5191] StaxUtils readQName not accepting leading and trailing whitespcaes
  ........
  
........

Modified:
    cxf/branches/2.6.x-fixes/   (props changed)
    cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
    cxf/branches/2.6.x-fixes/api/src/test/java/org/apache/cxf/staxutils/StaxUtilsTest.java

Propchange: cxf/branches/2.6.x-fixes/
            ('svn:mergeinfo' removed)

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

Modified: cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java?rev=1512288&r1=1512287&r2=1512288&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java (original)
+++ cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java Fri
Aug  9 12:46:14 2013
@@ -1529,6 +1529,7 @@ public final class StaxUtils {
         if (value == null) {
             return null;
         }
+        value = value.trim();
         
         int index = value.indexOf(":");
 

Modified: cxf/branches/2.6.x-fixes/api/src/test/java/org/apache/cxf/staxutils/StaxUtilsTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/api/src/test/java/org/apache/cxf/staxutils/StaxUtilsTest.java?rev=1512288&r1=1512287&r2=1512288&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/api/src/test/java/org/apache/cxf/staxutils/StaxUtilsTest.java
(original)
+++ cxf/branches/2.6.x-fixes/api/src/test/java/org/apache/cxf/staxutils/StaxUtilsTest.java
Fri Aug  9 12:46:14 2013
@@ -334,4 +334,34 @@ public class StaxUtilsTest extends Asser
         
         assertEquals(in.toString(), out.toString());
     }
+    
+    @Test
+    public void testQName() throws Exception {
+        StringBuilder in = new StringBuilder();
+        in.append("<f:foo xmlns:f=\"http://example.com/\">");
+        in.append("<bar>f:Bar</bar>");
+        in.append("<bar> f:Bar </bar>");
+        in.append("<bar>x:Bar</bar>");
+        in.append("</f:foo>");
+
+        XMLStreamReader reader = StaxUtils.createXMLStreamReader(
+             new ByteArrayInputStream(in.toString().getBytes()));
+        
+        QName qname = new QName("http://example.com/", "Bar");
+        assertEquals(XMLStreamReader.START_ELEMENT, reader.next());
+        assertEquals(XMLStreamReader.START_ELEMENT, reader.next());
+        // first bar
+        assertEquals(qname, StaxUtils.readQName(reader));
+        assertEquals(XMLStreamReader.START_ELEMENT, reader.next());
+        // second bar
+        assertEquals(qname, StaxUtils.readQName(reader));
+        assertEquals(XMLStreamReader.START_ELEMENT, reader.next());
+        // third bar
+        try {
+            StaxUtils.readQName(reader);
+            fail("invalid qname in mapping");
+        } catch (Exception e) {
+            // ignore
+        }
+    }
 }



Mime
View raw message