axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: xml-axis/java/test/encoding TestDOM.java
Date Tue, 04 Dec 2001 13:31:34 GMT
dims        01/12/04 05:31:34

  Modified:    java/src/org/apache/axis/encoding SerializationContext.java
               java/test/encoding TestDOM.java
  Log:
  - Fix serialization problem if DOM element has a null localpart reported by "David Melgar"
<dmelgar@us.ibm.com>
  - Added a modified version of test case from "David Melgar" <dmelgar@us.ibm.com>
  
  Revision  Changes    Path
  1.67      +8 -4      xml-axis/java/src/org/apache/axis/encoding/SerializationContext.java
  
  Index: SerializationContext.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/SerializationContext.java,v
  retrieving revision 1.66
  retrieving revision 1.67
  diff -u -r1.66 -r1.67
  --- SerializationContext.java	2001/12/03 03:31:31	1.66
  +++ SerializationContext.java	2001/12/04 13:31:34	1.67
  @@ -57,12 +57,13 @@
   
   import org.apache.axis.AxisEngine;
   import org.apache.axis.Constants;
  -import org.apache.axis.MessageContext;
   import org.apache.axis.Message;
  +import org.apache.axis.MessageContext;
  +import org.apache.axis.attachments.Attachments;
   import org.apache.axis.client.Call;
  +import org.apache.axis.utils.JavaUtils;
   import org.apache.axis.utils.Mapping;
   import org.apache.axis.utils.NSStack;
  -import org.apache.axis.utils.JavaUtils;
   import org.apache.axis.utils.XMLUtils;
   import org.apache.log4j.Category;
   import org.w3c.dom.Attr;
  @@ -83,7 +84,6 @@
   import java.util.HashSet;
   import java.util.Iterator;
   import java.util.Stack;
  -import org.apache.axis.attachments.Attachments;
   
   /** Manage a serialization, including keeping track of namespace mappings
    * and element stacks.
  @@ -641,7 +641,11 @@
               }
           }
   
  -        QName qName = new QName(el.getNamespaceURI(), el.getLocalName());
  +        String namespaceURI = el.getNamespaceURI();
  +        String localPart = el.getLocalName();
  +        if(namespaceURI == null || namespaceURI.length()==0)
  +            localPart = el.getNodeName();
  +        QName qName = new QName(namespaceURI, localPart);
   
           startElement(qName, attributes);
   
  
  
  
  1.7       +8 -2      xml-axis/java/test/encoding/TestDOM.java
  
  Index: TestDOM.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/encoding/TestDOM.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TestDOM.java	2001/11/02 03:07:42	1.6
  +++ TestDOM.java	2001/12/04 13:31:34	1.7
  @@ -6,11 +6,11 @@
   import org.apache.axis.AxisEngine;
   import org.apache.axis.Message;
   import org.apache.axis.MessageContext;
  +import org.apache.axis.message.SOAPBodyElement;
   import org.apache.axis.message.SOAPEnvelope;
   import org.apache.axis.server.AxisServer;
  +import org.apache.axis.utils.XMLUtils;
   
  -
  -
   /**
   
    * Verify that deserialization actually can cause the soap service
  @@ -105,6 +105,12 @@
   
          assertEquals("Request is not the same as the result.", request, result);
   
  +    }
  +    
  +    public void testEmptyNode() throws Exception 
  +    {
  +        SOAPBodyElement body = new SOAPBodyElement(XMLUtils.newDocument().createElement("tmp"));
  +        assertEquals("<tmp/>",body.toString());
       }
       
       public static void main(String [] args) throws Exception
  
  
  

Mime
View raw message