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/message TestMessageElement.java
Date Tue, 05 Nov 2002 18:43:52 GMT
dims        2002/11/05 10:43:52

  Modified:    java/src/org/apache/axis/message MessageElement.java
               java/test/message TestMessageElement.java
  Log:
  Fix for Bug 14134 - QName Attributes lose namespace mapping in MessageElement after Serialization.
  from chrisw@wolfram.com (Christopher Williamson)
  
  Revision  Changes    Path
  1.137     +1 -2      xml-axis/java/src/org/apache/axis/message/MessageElement.java
  
  Index: MessageElement.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/MessageElement.java,v
  retrieving revision 1.136
  retrieving revision 1.137
  diff -u -r1.136 -r1.137
  --- MessageElement.java	5 Nov 2002 16:39:05 -0000	1.136
  +++ MessageElement.java	5 Nov 2002 18:43:52 -0000	1.137
  @@ -722,11 +722,10 @@
               for (int i = 0; i < qNameAttrs.size(); i++) {
                   QNameAttr attr = (QNameAttr)qNameAttrs.get(i);
                   QName attrName = attr.name;
  -                addAttribute(attrName.getNamespaceURI(),
  +                setAttribute(attrName.getNamespaceURI(),
                                attrName.getLocalPart(),
                                context.qName2String(attr.value));
               }
  -            qNameAttrs = null;
           }
   
           /**
  
  
  
  1.8       +18 -4     xml-axis/java/test/message/TestMessageElement.java
  
  Index: TestMessageElement.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/message/TestMessageElement.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TestMessageElement.java	5 Nov 2002 15:53:18 -0000	1.7
  +++ TestMessageElement.java	5 Nov 2002 18:43:52 -0000	1.8
  @@ -59,6 +59,8 @@
   
   import javax.xml.soap.SOAPElement;
   import javax.xml.soap.Name;
  +import javax.xml.namespace.QName;
  +
   import org.apache.axis.soap.SOAPConstants;
   
   import org.apache.axis.message.MessageElement;
  @@ -178,15 +180,27 @@
           assertTrue("Did not find namespace declaration \"pre\"", found);
       }
       
  -    public void testGetNamespacePrefixes() throws Exception {
  +    public void testQNameAttrTest() throws Exception {
           MessageElement me = 
               new MessageElement("http://www.wolfram.com","Test");
  -        Iterator it = me.getNamespacePrefixes();
  -        assertTrue(it != null);
  +        me.addAttribute(
  +            "http://www.w3.org/2001/XMLSchema-instance", 
  +            "type",
  +            new QName("http://www.wolfram2.com", "type1"));
  +        MessageElement me2 = 
  +            new MessageElement("http://www.wolfram.com", "Child", (Object)"1");
  +        me2.addAttribute(
  +            "http://www.w3.org/2001/XMLSchema-instance", 
  +            "type",
  +            new QName("http://www.w3.org/2001/XMLSchema", "int"));
  +        me.addChildElement(me2);
  +        String s1 = me.toString();
  +        String s2 = me.toString();
  +        assertEquals(s1, s2);
       }
       
       public static void main(String[] args) throws Exception {
           TestMessageElement tester = new TestMessageElement("TestMessageElement");
  -        tester.testGetNamespacePrefixes();
  +        tester.testQNameAttrTest();
       }
   }
  
  
  

Mime
View raw message