axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject cvs commit: xml-axis/java/test/encoding TestDeser.java TestDeser1999.java TestDeser2000.java TestDeser2001.java
Date Thu, 27 Jun 2002 23:10:37 GMT
rubys       2002/06/27 16:10:37

  Modified:    java/src/org/apache/axis/encoding DeserializerImpl.java
               java/test/encoding TestDeser.java TestDeser1999.java
                        TestDeser2000.java TestDeser2001.java
  Log:
  Add support for 1999 and 2000's schema's xsi:null attribute.  Based on
  problem report and patch from Costin Manolache, with the addition of
  a test case.
  
  Revision  Changes    Path
  1.19      +4 -1      xml-axis/java/src/org/apache/axis/encoding/DeserializerImpl.java
  
  Index: DeserializerImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/DeserializerImpl.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- DeserializerImpl.java	18 Jun 2002 16:53:10 -0000	1.18
  +++ DeserializerImpl.java	27 Jun 2002 23:10:36 -0000	1.19
  @@ -322,7 +322,10 @@
           // there is nothing to deserialize.
           if (JavaUtils.isTrueExplicitly(Constants.getValue(attributes,
                                           Constants.URIS_SCHEMA_XSI,
  -                                        "nil"))) {
  +                                        "nil")) ||
  +            JavaUtils.isTrueExplicitly(Constants.getValue(attributes,
  +                                        Constants.URIS_SCHEMA_XSI,
  +                                        "null"))) {
             value = null;
             isNil = true;
             return;
  
  
  
  1.38      +0 -33     xml-axis/java/test/encoding/TestDeser.java
  
  Index: TestDeser.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/encoding/TestDeser.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- TestDeser.java	11 Jun 2002 14:54:02 -0000	1.37
  +++ TestDeser.java	27 Jun 2002 23:10:36 -0000	1.38
  @@ -285,34 +285,6 @@
                       list, true);
       }
   
  -    public void testArrayWithNilInt() throws Exception {
  -        ArrayList list = new ArrayList(4);
  -        list.add(new Integer(1));
  -        list.add(null);
  -        list.add(new Integer(3));
  -        deserialize("<result xsi:type=\"soapenc:Array\" " +
  -                            "soapenc:arrayType=\"xsd:int[3]\"> " +
  -                       "<item xsi:type=\"xsd:int\">1</item>" +
  -                       "<item xsi:nil=\"true\"/>" +
  -                       "<item xsi:type=\"xsd:int\">3</item>" +
  -                    "</result>",
  -                    list, true);
  -    }
  -    
  -    public void testArrayWithNilString() throws Exception {
  -        ArrayList list = new ArrayList(4);
  -        list.add("abc");
  -        list.add(null);
  -        list.add("def");
  -        deserialize("<result xsi:type=\"soapenc:Array\" " +
  -                            "soapenc:arrayType=\"xsd:string[3]\"> " +
  -                       "<item xsi:type=\"xsd:string\">abc</item>" +
  -                       "<item xsi:nil=\"true\"/>" +
  -                       "<item xsi:type=\"xsd:string\">def</item>" +
  -                    "</result>",
  -                    list, true);
  -    }
  -    
       public void testMap() throws Exception {
           HashMap m = new HashMap();
           m.put("abcKey", "abcVal");
  @@ -339,11 +311,6 @@
                       "abc");
       }
   
  -    public void testNilSOAPBoolean() throws Exception {
  -        deserialize("<result xsi:type=\"soapenc:boolean\" xsi:nil=\"true\" />",
  -                    null);
  -    }
  -    
       // Complicated array tests
   
       // type=soapenc:Array
  
  
  
  1.6       +52 -0     xml-axis/java/test/encoding/TestDeser1999.java
  
  Index: TestDeser1999.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/encoding/TestDeser1999.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestDeser1999.java	31 May 2002 19:08:10 -0000	1.5
  +++ TestDeser1999.java	27 Jun 2002 23:10:36 -0000	1.6
  @@ -1,5 +1,7 @@
   package test.encoding;
   
  +import java.util.ArrayList;
  +import java.util.HashMap;
   import org.apache.axis.Constants;
   
   /** 
  @@ -10,5 +12,55 @@
       public TestDeser1999(String name) {
           super(name, Constants.URI_1999_SCHEMA_XSI,
                       Constants.URI_1999_SCHEMA_XSD);
  +    }
  +
  +    public void testMapWithNulls() throws Exception {
  +        HashMap m = new HashMap();
  +        m.put(null, new Boolean("false"));
  +        m.put("hi", null);
  +        deserialize("<result xsi:type=\"xmlsoap:Map\" " +
  +                    "xmlns:xmlsoap=\"http://xml.apache.org/xml-soap\"> " +
  +                      "<item>" +
  +                       "<key xsi:null=\"true\"/>" +
  +                       "<value xsi:type=\"xsd:boolean\">false</value>" + 
  +                      "</item><item>" +
  +                       "<key xsi:type=\"string\">hi</key>" +
  +                       "<value xsi:null=\"true\"/>" +
  +                      "</item>" +
  +                    "</result>",
  +                    m);
  +    }
  +
  +    public void testArrayWithNullInt() throws Exception {
  +        ArrayList list = new ArrayList(4);
  +        list.add(new Integer(1));
  +        list.add(null);
  +        list.add(new Integer(3));
  +        deserialize("<result xsi:type=\"soapenc:Array\" " +
  +                            "soapenc:arrayType=\"xsd:int[3]\"> " +
  +                       "<item xsi:type=\"xsd:int\">1</item>" +
  +                       "<item xsi:null=\"true\"/>" +
  +                       "<item xsi:type=\"xsd:int\">3</item>" +
  +                    "</result>",
  +                    list, true);
  +    }
  +    
  +    public void testArrayWithNullString() throws Exception {
  +        ArrayList list = new ArrayList(4);
  +        list.add("abc");
  +        list.add(null);
  +        list.add("def");
  +        deserialize("<result xsi:type=\"soapenc:Array\" " +
  +                            "soapenc:arrayType=\"xsd:string[3]\"> " +
  +                       "<item xsi:type=\"xsd:string\">abc</item>" +
  +                       "<item xsi:null=\"true\"/>" +
  +                       "<item xsi:type=\"xsd:string\">def</item>" +
  +                    "</result>",
  +                    list, true);
  +    }
  +    
  +    public void testNullSOAPBoolean() throws Exception {
  +        deserialize("<result xsi:type=\"soapenc:boolean\" xsi:null=\"true\" />",
  +                    null);
       }
   }
  
  
  
  1.6       +52 -0     xml-axis/java/test/encoding/TestDeser2000.java
  
  Index: TestDeser2000.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/encoding/TestDeser2000.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestDeser2000.java	31 May 2002 19:08:10 -0000	1.5
  +++ TestDeser2000.java	27 Jun 2002 23:10:36 -0000	1.6
  @@ -1,5 +1,7 @@
   package test.encoding;
   
  +import java.util.ArrayList;
  +import java.util.HashMap;
   import org.apache.axis.Constants;
   
   /** 
  @@ -10,5 +12,55 @@
       public TestDeser2000(String name) {
           super(name, Constants.URI_2000_SCHEMA_XSI,
                       Constants.URI_2000_SCHEMA_XSD);
  +    }
  +
  +    public void testMapWithNulls() throws Exception {
  +        HashMap m = new HashMap();
  +        m.put(null, new Boolean("false"));
  +        m.put("hi", null);
  +        deserialize("<result xsi:type=\"xmlsoap:Map\" " +
  +                    "xmlns:xmlsoap=\"http://xml.apache.org/xml-soap\"> " +
  +                      "<item>" +
  +                       "<key xsi:null=\"true\"/>" +
  +                       "<value xsi:type=\"xsd:boolean\">false</value>" + 
  +                      "</item><item>" +
  +                       "<key xsi:type=\"string\">hi</key>" +
  +                       "<value xsi:null=\"true\"/>" +
  +                      "</item>" +
  +                    "</result>",
  +                    m);
  +    }
  +
  +    public void testArrayWithNullInt() throws Exception {
  +        ArrayList list = new ArrayList(4);
  +        list.add(new Integer(1));
  +        list.add(null);
  +        list.add(new Integer(3));
  +        deserialize("<result xsi:type=\"soapenc:Array\" " +
  +                            "soapenc:arrayType=\"xsd:int[3]\"> " +
  +                       "<item xsi:type=\"xsd:int\">1</item>" +
  +                       "<item xsi:null=\"true\"/>" +
  +                       "<item xsi:type=\"xsd:int\">3</item>" +
  +                    "</result>",
  +                    list, true);
  +    }
  +    
  +    public void testArrayWithNullString() throws Exception {
  +        ArrayList list = new ArrayList(4);
  +        list.add("abc");
  +        list.add(null);
  +        list.add("def");
  +        deserialize("<result xsi:type=\"soapenc:Array\" " +
  +                            "soapenc:arrayType=\"xsd:string[3]\"> " +
  +                       "<item xsi:type=\"xsd:string\">abc</item>" +
  +                       "<item xsi:null=\"true\"/>" +
  +                       "<item xsi:type=\"xsd:string\">def</item>" +
  +                    "</result>",
  +                    list, true);
  +    }
  +    
  +    public void testNullSOAPBoolean() throws Exception {
  +        deserialize("<result xsi:type=\"soapenc:boolean\" xsi:null=\"true\" />",
  +                    null);
       }
   }
  
  
  
  1.15      +34 -0     xml-axis/java/test/encoding/TestDeser2001.java
  
  Index: TestDeser2001.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/encoding/TestDeser2001.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- TestDeser2001.java	11 Jun 2002 14:54:02 -0000	1.14
  +++ TestDeser2001.java	27 Jun 2002 23:10:36 -0000	1.15
  @@ -3,6 +3,7 @@
   import org.apache.axis.Constants;
   import org.apache.axis.encoding.Hex;
   
  +import java.util.ArrayList;
   import java.util.Calendar;
   import java.util.HashMap;
   import java.util.SimpleTimeZone;
  @@ -141,4 +142,37 @@
                       m);
       }
   
  +    public void testArrayWithNilInt() throws Exception {
  +        ArrayList list = new ArrayList(4);
  +        list.add(new Integer(1));
  +        list.add(null);
  +        list.add(new Integer(3));
  +        deserialize("<result xsi:type=\"soapenc:Array\" " +
  +                            "soapenc:arrayType=\"xsd:int[3]\"> " +
  +                       "<item xsi:type=\"xsd:int\">1</item>" +
  +                       "<item xsi:nil=\"true\"/>" +
  +                       "<item xsi:type=\"xsd:int\">3</item>" +
  +                    "</result>",
  +                    list, true);
  +    }
  +    
  +    public void testArrayWithNilString() throws Exception {
  +        ArrayList list = new ArrayList(4);
  +        list.add("abc");
  +        list.add(null);
  +        list.add("def");
  +        deserialize("<result xsi:type=\"soapenc:Array\" " +
  +                            "soapenc:arrayType=\"xsd:string[3]\"> " +
  +                       "<item xsi:type=\"xsd:string\">abc</item>" +
  +                       "<item xsi:nil=\"true\"/>" +
  +                       "<item xsi:type=\"xsd:string\">def</item>" +
  +                    "</result>",
  +                    list, true);
  +    }
  +    
  +    public void testNilSOAPBoolean() throws Exception {
  +        deserialize("<result xsi:type=\"soapenc:boolean\" xsi:nil=\"true\" />",
  +                    null);
  +    }
  +    
   }
  
  
  

Mime
View raw message