You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by ru...@apache.org on 2006/04/24 07:30:48 UTC

svn commit: r396436 - /webservices/commons/trunk/modules/axiom/test/org/apache/axiom/om/DefaultNSHandlingTest.java

Author: ruchithf
Date: Sun Apr 23 22:30:48 2006
New Revision: 396436

URL: http://svn.apache.org/viewcvs?rev=396436&view=rev
Log:
When a child element declares a namespace with a prefix which is the the default ns of the parent element , the child of the serialized XML has two ns declarations with the same prefix. This is invalid XML and parser throws an error. A test scenario was added to test this and commented it out. Chinthaka please have a look at it. 


Modified:
    webservices/commons/trunk/modules/axiom/test/org/apache/axiom/om/DefaultNSHandlingTest.java

Modified: webservices/commons/trunk/modules/axiom/test/org/apache/axiom/om/DefaultNSHandlingTest.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/test/org/apache/axiom/om/DefaultNSHandlingTest.java?rev=396436&r1=396435&r2=396436&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/test/org/apache/axiom/om/DefaultNSHandlingTest.java (original)
+++ webservices/commons/trunk/modules/axiom/test/org/apache/axiom/om/DefaultNSHandlingTest.java Sun Apr 23 22:30:48 2006
@@ -1,13 +1,18 @@
 package org.apache.axiom.om;
 
-import junit.framework.TestCase;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLOutputFactory;
 import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
+
 import java.io.ByteArrayInputStream;
 import java.util.Iterator;
+
+import junit.framework.TestCase;
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -80,6 +85,26 @@
 
 
     }
+    
+//    public void testChildReDeclaringParentsDefaultNSWithPrefix() {
+//        try {
+//            OMFactory fac = OMAbstractFactory.getOMFactory();
+//            OMElement elem = fac.createOMElement("RequestSecurityToken", null);
+//            elem.declareDefaultNamespace("http://schemas.xmlsoap.org/ws/2005/02/trust");
+//            fac.createOMElement(new QName("TokenType"), elem).setText("test");
+//            fac.createOMElement(new QName("RequestType"), elem).setText("test1");;
+//            
+//            fac.createOMElement(new QName("http://schemas.xmlsoap.org/ws/2005/02/trust","Entropy", "wst"), elem);
+//            String xml = elem.toString();
+//            
+//            XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new ByteArrayInputStream(xml.getBytes()));
+//            
+//            StAXOMBuilder builder = new StAXOMBuilder(reader);
+//            builder.getDocumentElement().build();
+//        }catch (Exception e) {
+//            fail(e.getMessage());
+//        }
+//    }
 
     public static void main(String[] args) {
         try {