axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject cvs commit: xml-axis/java/test/wsdl/roundtrip BondInvestment.java RoundtripTestServiceTestCase.java RoundtripTestSoapBindingImpl.java
Date Thu, 25 Jul 2002 16:42:06 GMT
scheu       2002/07/25 09:42:06

  Modified:    java/src/org/apache/axis/utils axisNLS.properties
               java/src/org/apache/axis/wsdl/fromJava Types.java
               java/test/wsdl/roundtrip BondInvestment.java
                        RoundtripTestServiceTestCase.java
                        RoundtripTestSoapBindingImpl.java
  Log:
  Changes made:
     * Cleanup in Types.java for the case where the javaType is not
       a compatible bean.  This cleanup was requested via email
       with an axis user.
     * Added HashMap test to the roundtrip test.
  
  Revision  Changes    Path
  1.30      +1 -1      xml-axis/java/src/org/apache/axis/utils/axisNLS.properties
  
  Index: axisNLS.properties
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/axisNLS.properties,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- axisNLS.properties	20 Jul 2002 19:46:15 -0000	1.29
  +++ axisNLS.properties	25 Jul 2002 16:42:05 -0000	1.30
  @@ -949,5 +949,5 @@
   badClassFile00=Error looking for paramter names in bytecode: input does not appear to be
a valid class file
   unexpectedEOF00=Error looking for paramter names in bytecode: unexpected end of file
   unexpectedBytes00=Error looking for paramter names in bytecode: unexpected bytes in file
  -
  +beanCompatExtends00=The class {0} extends non-bean class {1}.  An xml schema anyType will
be used to define {0} in the wsdl file.
   
  
  
  
  1.48      +25 -7     xml-axis/java/src/org/apache/axis/wsdl/fromJava/Types.java
  
  Index: Types.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/fromJava/Types.java,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- Types.java	23 Jul 2002 14:02:57 -0000	1.47
  +++ Types.java	25 Jul 2002 16:42:05 -0000	1.48
  @@ -260,14 +260,21 @@
               if (wsdlTypesElem == null) {
                   writeWsdlTypesElement();
               }
  -            return writeTypeAsElement(type, qname);
  +            // If writeTypeAsElement returns null, then
  +            // then no element was written due to problems.
  +            // return an anytype in such situations.
  +            qname = writeTypeAsElement(type, qname);
  +            if (qname == null) {
  +                qname = Constants.XSD_ANYTYPE;
  +            }
  +            return qname;
           }
       }
   
       /**
        * Create a schema element for the given type
        * @param type the class type
  -     * @return the QName of the generated Element
  +     * @return the QName of the generated Element or null if no element written
        */
       private QName writeTypeAsElement(Class type, QName qName) throws AxisFault {
           if (qName == null ||
  @@ -492,13 +499,12 @@
           }
   
           // If no factory is found, use the BeanSerializerFactory
  -        // if applicable, otherwise issue errors and return anyType
  +        // if applicable, otherwise issue errors and treat as an anyType
           if (factory == null) {
               if (isBeanCompatible(type, true)) {
                   factory = new BeanSerializerFactory(type, qName);
               } else {
  -                return Constants.NS_PREFIX_SCHEMA_XSD + ":" +
  -                    Constants.XSD_ANYTYPE.getLocalPart();
  +                return null; // Don't return an element name
               }
           }
   
  @@ -513,7 +519,7 @@
           }
   
           // Write the namespace
  -       writeTypeNamespace(type, qName);
  +        writeTypeNamespace(type, qName);
   
           // If an array the component type should be processed first
           String componentTypeName = null;
  @@ -1017,7 +1023,19 @@
               superClass != org.apache.axis.AxisFault.class &&
               (stopClasses == null ||
                !(stopClasses.contains(superClass.getName()))) ) {
  -            return isBeanCompatible(superClass, issueErrors);
  +
  +            if (!isBeanCompatible(superClass, false)) {
  +
  +                if (issueErrors && 
  +                    !beanCompatErrs.contains(javaType)) {
  +                    log.error(JavaUtils.getMessage("beanCompatExtends00",
  +                                                   javaType.getName(),
  +                                                   superClass.getName(),
  +                                                    javaType.getName()));
  +                    beanCompatErrs.add(javaType);
  +                }
  +                return false;
  +            }
           }
           return true;
       }
  
  
  
  1.7       +9 -0      xml-axis/java/test/wsdl/roundtrip/BondInvestment.java
  
  Index: BondInvestment.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/wsdl/roundtrip/BondInvestment.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- BondInvestment.java	28 May 2002 17:57:01 -0000	1.6
  +++ BondInvestment.java	25 Jul 2002 16:42:06 -0000	1.7
  @@ -59,6 +59,7 @@
   import java.math.BigDecimal;
   import java.util.Calendar;
   import test.wsdl.roundtrip.CallOptions;
  +import java.util.HashMap;
   
   /**
    * The BondInvestment class contains data members for all the
  @@ -96,6 +97,7 @@
       public Object options2;
       public Object options3;
       public int id;
  +    public HashMap map;
   
       public BondInvestment() {
   
  @@ -196,4 +198,11 @@
           this.options = options;
       }
   
  +    public HashMap getMap() {
  +        return map;
  +    }
  +
  +    public void setOptions(HashMap map) {
  +        this.map = map;
  +    }
   } // BondInvestment 
  
  
  
  1.16      +12 -0     xml-axis/java/test/wsdl/roundtrip/RoundtripTestServiceTestCase.java
  
  Index: RoundtripTestServiceTestCase.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/wsdl/roundtrip/RoundtripTestServiceTestCase.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- RoundtripTestServiceTestCase.java	16 Jul 2002 22:42:51 -0000	1.15
  +++ RoundtripTestServiceTestCase.java	25 Jul 2002 16:42:06 -0000	1.16
  @@ -81,6 +81,7 @@
   import test.wsdl.roundtrip.InvalidTickerSymbol;
   import test.wsdl.roundtrip.InvalidTradeExchange;
   import test.wsdl.roundtrip.InvalidCompanyId;
  +import java.util.HashMap;
   
   import test.wsdl.roundtrip.holders.BondInvestmentHolder;
   
  @@ -280,6 +281,8 @@
               date.setTimeZone(gmt);
               date.setTime(new Date(1013441507390L));
               callOptions[1].setCallDate(date);
  +            HashMap map = new HashMap();
  +            map.put("Test", "Test Works");
   
               short[] shortArray = {(short) 30};
               byte[] byteArray = {(byte) 1};
  @@ -288,6 +291,7 @@
   
               BondInvestment sendValue = new BondInvestment();
   
  +            sendValue.setMap(map);
               sendValue.setOptions(callOptions);
               sendValue.setOptions2(callOptions);
               sendValue.setOptions3(callOptions[0]);
  @@ -318,6 +322,8 @@
               BondInvestment actual = binding.methodBondInvestmentInOut(sendValue);
               date.setTime(new Date(1013441507308L));
   
  +            assertEquals("Returned map is not correct.",
  +                         (String) actual.getMap().get("Test"), "Test Works");
               assertEquals("The expected and actual values did not match.",
                            date,
                            actual.getOptions()[0].getCallDate());
  @@ -415,6 +421,8 @@
               TimeZone gmt = TimeZone.getTimeZone("GMT");
               date.setTimeZone(gmt);
               date.setTime(new Date(1013441507308L));
  +            assertEquals("Returned map is not correct.",
  +                         (String) actual.getMap().get("Test"), "Test Works");
               assertEquals("The expected and actual values did not match.",
                            date,
                            actual.getOptions()[0].getCallDate());
  @@ -519,6 +527,9 @@
               date.setTimeZone(gmt);
               date.setTime(new Date(1013441507390L));
               callOptions[1].setCallDate(date);
  +            HashMap map = new HashMap();
  +            map.put("Test", "Test Works");
  +
   
               short[] shortArray = {(short) 30};
               byte[] byteArray = {(byte) 1};
  @@ -527,6 +538,7 @@
   
               BondInvestment sendValue = new BondInvestment();
               
  +            sendValue.setMap(map);
               sendValue.setOptions(callOptions);
               sendValue.setOptions2(callOptions);
               sendValue.setOptions3(callOptions[0]);
  
  
  
  1.14      +13 -3     xml-axis/java/test/wsdl/roundtrip/RoundtripTestSoapBindingImpl.java
  
  Index: RoundtripTestSoapBindingImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/wsdl/roundtrip/RoundtripTestSoapBindingImpl.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- RoundtripTestSoapBindingImpl.java	21 Jun 2002 14:48:38 -0000	1.13
  +++ RoundtripTestSoapBindingImpl.java	25 Jul 2002 16:42:06 -0000	1.14
  @@ -75,6 +75,7 @@
   import java.rmi.RemoteException;
   
   import javax.xml.rpc.holders.StringHolder;
  +import java.util.HashMap;
   
   /**
    * This class contains the implementations of the methods defined in the
  @@ -136,12 +137,15 @@
           date.setTimeZone(gmt);
           date.setTime(new Date(1013441507328L));
           callOptions[1].setCallDate(date);
  +        HashMap map = new HashMap();
  +        map.put("Test", "Test Works");
   
           Short[] wrapperShortArray = {new Short((short) 33), new Short((short) 86)};
           Byte[] wrapperByteArray = {new Byte((byte) 4), new Byte((byte) 18)};
   
           BondInvestment sendValue = new BondInvestment();
  -        
  +
  +        sendValue.setMap(map);
           sendValue.setOptions(callOptions);
           sendValue.setOptions2(callOptions);
           sendValue.setOptions3(callOptions[0]);
  @@ -191,7 +195,8 @@
           Calendar expectedDate4 = Calendar.getInstance();
           expectedDate4.setTimeZone(gmt);
           expectedDate4.setTime(new Date(1012937861996L));
  -        if ((in0.getOptions()[0].getCallDate().equals(expectedDate0)) &&
  +        if ((in0.getMap().get("Test").equals("Test Works")) &&
  +            (in0.getOptions()[0].getCallDate().equals(expectedDate0)) &&
               (in0.getOptions()[1].getCallDate().equals(expectedDate1)) &&
               (((CallOptions[])in0.getOptions2())[0].getCallDate().equals(expectedDate2))
&&
               (((CallOptions[])in0.getOptions2())[1].getCallDate().equals(expectedDate3))
&&
  @@ -242,9 +247,13 @@
           callOptions[1].setCallDate(date);
           Short[] wrapperShortArray = {new Short((short) 33), new Short((short) 86)};
           Byte[] wrapperByteArray = {new Byte((byte) 4), new Byte((byte) 18)};
  +        HashMap map = new HashMap();
  +        map.put("Test", "Test Works");
  +
   
           BondInvestment sendValue = new BondInvestment();
           
  +        sendValue.setMap(map);
           sendValue.setOptions(callOptions);
           sendValue.setOptions2(callOptions);
           sendValue.setOptions3(callOptions[0]);
  @@ -293,7 +302,8 @@
           Calendar expectedDate4 = Calendar.getInstance();
           expectedDate4.setTimeZone(gmt);
           expectedDate4.setTime(new Date(1012937861996L));
  -        if (!((in0.getOptions()[0].getCallDate().equals(expectedDate0)) &&
  +        if (!((in0.getMap().get("Test").equals("Test Works")) &&
  +              (in0.getOptions()[0].getCallDate().equals(expectedDate0)) &&
                 (in0.getOptions()[1].getCallDate().equals(expectedDate1)) &&
                 (((CallOptions[])in0.getOptions2())[0].getCallDate().equals(expectedDate2))
&&
                 (((CallOptions[])in0.getOptions2())[1].getCallDate().equals(expectedDate3))
&&
  
  
  

Mime
View raw message