axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: r349959 - in /webservices/axis2/trunk/java/modules/codegen: src/org/apache/axis2/databinding/schema/util/ test/org/apache/axis2/databinding/schema/populate/derived/ test/org/apache/axis2/databinding/schema/populate/simple/
Date Wed, 30 Nov 2005 14:46:34 GMT
Author: ajith
Date: Wed Nov 30 06:46:04 2005
New Revision: 349959

URL: http://svn.apache.org/viewcvs?rev=349959&view=rev
Log:
1. Updated all the test cases for ADB. There are these things to complete
    I. Some test cases are missing (Say for NCName, NMToken and all)
    II. The comparisons are  not included in some test cases, especially Time and dateTime where the comparisons should take into account the different representations of the same information.

Modified:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/util/ConverterUtil.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/AbstractDerivedPopulater.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeBytePopulateTest.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeIntPopulateTest.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeIntegerPopulateTest.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeLongPopulateTest.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeNegativeIntegerPopulateTest.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeNonNegativeIntegerPopulateTest.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeNonPositiveIntegerPopulateTest.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypePositveIntegerPopulateTest.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeShortPopulateTest.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeUnsignedBytePopulateTest.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeUnsignedIntPopulateTest.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeUnsignedLongPopulateTest.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeUnsignedShortPopulateTest.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/SimpleTypeHexBinaryPopulateTest.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/SimpleTypeMonthDayPopulateTest.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/SimpleTypeTimePopulateTest.java

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/util/ConverterUtil.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/util/ConverterUtil.java?rev=349959&r1=349958&r2=349959&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/util/ConverterUtil.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/util/ConverterUtil.java Wed Nov 30 06:46:04 2005
@@ -110,6 +110,48 @@
         return o.toString();
     }
 
+    public static String convertToString(HexBinary o) {
+        return o.toString();
+    }
+
+    public static String convertToString(MonthDay o) {
+        return o.toString();
+    }
+
+    public static String convertToString(Time o) {
+        return o.toString();
+    }
+    public static String convertToString(Byte o) {
+        return o.toString();
+    }
+
+    public static String convertToString(BigInteger o) {
+        return o.toString();
+    }
+    public static String convertToString(Integer o) {
+        return o.toString();
+    }
+
+    public static String convertToString(Long o) {
+        return o.toString();
+    }
+
+     public static String convertToString(Short o) {
+        return o.toString();
+    }
+
+    public static String convertToString(UnsignedByte o) {
+           return o.toString();
+       }
+
+     public static String convertToString(UnsignedInt o) {
+           return o.toString();
+       }
+
+    public static String convertToString(UnsignedLong o) {
+           return o.toString();
+       }
+
     public static String convertToString(Object o) {
         return o.toString();
     }
@@ -126,7 +168,7 @@
         return o.toString();
     }
 
-     public static String convertToString(Month o) {
+    public static String convertToString(Month o) {
         return o.toString();
     }
     /* ################################################################################ */

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/AbstractDerivedPopulater.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/AbstractDerivedPopulater.java?rev=349959&r1=349958&r2=349959&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/AbstractDerivedPopulater.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/AbstractDerivedPopulater.java Wed Nov 30 06:46:04 2005
@@ -6,6 +6,9 @@
 import javax.xml.stream.XMLInputFactory;
 import java.io.ByteArrayInputStream;
 import java.lang.reflect.Method;
+import java.beans.BeanInfo;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -37,6 +40,34 @@
 
         return obj;
 
+    }
 
+    protected  String className= null;
+    protected Class propertyClass = null;
+
+
+    protected void checkValue(String xmlToSet, String value) throws Exception {
+        Object o = process(xmlToSet, className);
+        Class beanClass = Class.forName(className);
+        BeanInfo info = Introspector.getBeanInfo(beanClass);
+        PropertyDescriptor[] propDescs = info.getPropertyDescriptors();
+        for (int i = 0; i < propDescs.length; i++) {
+            PropertyDescriptor propDesc = propDescs[i];
+            if  (propDesc.getPropertyType().equals(propertyClass)){
+                String s = convertToString(propDesc.getReadMethod().invoke(o, null));
+                System.out.println("Asserting value = " + s + " from " + o);
+                compare(value,s);
+            }
+
+        }
+
+    }
+
+    protected void compare(String val1,String val2){
+        assertEquals(val1,val2);
+    }
+
+    protected String convertToString(Object o){
+        return o.toString();
     }
 }

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeBytePopulateTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeBytePopulateTest.java?rev=349959&r1=349958&r2=349959&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeBytePopulateTest.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeBytePopulateTest.java Wed Nov 30 06:46:04 2005
@@ -1,5 +1,8 @@
 package org.apache.axis2.databinding.schema.populate.derived;
 
+import org.apache.axis2.databinding.schema.types.HexBinary;
+import org.apache.axis2.databinding.schema.util.ConverterUtil;
+
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -17,15 +20,31 @@
  */
 
 public class DerivedTypeBytePopulateTest extends AbstractDerivedPopulater{
+
+     private String values[]= {
+            "1",
+            "0",
+            "2"
+    };
     private String xmlString[] = {
-            "<DerivedByte>1</DerivedByte>",
-            "<DerivedByte>0</DerivedByte>",
-            "<DerivedByte>2</DerivedByte>"
+            "<DerivedByte>"+values[0]+"</DerivedByte>",
+            "<DerivedByte>"+values[1]+"</DerivedByte>",
+            "<DerivedByte>"+values[2]+"</DerivedByte>"
     };
+
+    protected void setUp() throws Exception {
+        className = "org.soapinterop.DerivedByte";
+        propertyClass = byte.class;
+    }
+
     // force others to implement this method
     public void testPopulate() throws Exception {
-        process(xmlString[0],"org.soapinterop.DerivedByte");
-        process(xmlString[1],"org.soapinterop.DerivedByte");
-        process(xmlString[2],"org.soapinterop.DerivedByte");
+        for (int i = 0; i < values.length; i++) {
+            checkValue(xmlString[i],values[i]);
+        }
+    }
+
+    protected String convertToString(Object o) {
+        return ConverterUtil.convertToString((Byte)o);
     }
 }

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeIntPopulateTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeIntPopulateTest.java?rev=349959&r1=349958&r2=349959&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeIntPopulateTest.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeIntPopulateTest.java Wed Nov 30 06:46:04 2005
@@ -1,5 +1,7 @@
 package org.apache.axis2.databinding.schema.populate.derived;
 
+import org.apache.axis2.databinding.schema.util.ConverterUtil;
+
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -17,15 +19,32 @@
  */
 
 public class DerivedTypeIntPopulateTest extends AbstractDerivedPopulater{
+    private String values[]= {
+            "122222",
+            "0",
+            "-2344556"
+    };
+
+
     private String xmlString[] = {
-            "<DerivedInt>122222</DerivedInt>",
-            "<DerivedInt>0</DerivedInt>",
-            "<DerivedInt>-2344556</DerivedInt>"
+            "<DerivedInt>"+values[0]+"</DerivedInt>",
+            "<DerivedInt>"+values[1]+"</DerivedInt>",
+            "<DerivedInt>"+values[2]+"</DerivedInt>"
     };
+
+    protected void setUp() throws Exception {
+        className = "org.soapinterop.DerivedInt";
+        propertyClass = int.class;
+    }
+
     // force others to implement this method
     public void testPopulate() throws Exception {
-        process(xmlString[0],"org.soapinterop.DerivedInt");
-        process(xmlString[1],"org.soapinterop.DerivedInt");
-        process(xmlString[2],"org.soapinterop.DerivedInt");
+        for (int i = 0; i < 2; i++) {
+            checkValue(xmlString[i],values[i]);
+        }
+    }
+
+    protected String convertToString(Object o) {
+        return ConverterUtil.convertToString((Integer)o);
     }
 }

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeIntegerPopulateTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeIntegerPopulateTest.java?rev=349959&r1=349958&r2=349959&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeIntegerPopulateTest.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeIntegerPopulateTest.java Wed Nov 30 06:46:04 2005
@@ -1,5 +1,9 @@
 package org.apache.axis2.databinding.schema.populate.derived;
 
+import org.apache.axis2.databinding.schema.util.ConverterUtil;
+
+import java.math.BigInteger;
+
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -17,15 +21,31 @@
  */
 
 public class DerivedTypeIntegerPopulateTest extends AbstractDerivedPopulater{
+
+     private String values[]= {
+            "122222",
+            "0",
+            "-2344556"
+    };
     private String xmlString[] = {
-            "<DerivedInteger>122222</DerivedInteger>",
-            "<DerivedInteger>0</DerivedInteger>",
-            "<DerivedInteger>-2344556</DerivedInteger>"
+            "<DerivedInteger>"+values[0]+"</DerivedInteger>",
+            "<DerivedInteger>"+values[1]+"</DerivedInteger>",
+            "<DerivedInteger>"+values[2]+"</DerivedInteger>"
     };
+
+    protected void setUp() throws Exception {
+        className = "org.soapinterop.DerivedInteger";
+        propertyClass = BigInteger.class;
+    }
+
     // force others to implement this method
     public void testPopulate() throws Exception {
-        process(xmlString[0],"org.soapinterop.DerivedInteger");
-        process(xmlString[1],"org.soapinterop.DerivedInteger");
-        process(xmlString[2],"org.soapinterop.DerivedInteger");
+        for (int i = 0; i < values.length; i++) {
+            checkValue(xmlString[i],values[i]);
+        }
+    }
+
+    protected String convertToString(Object o) {
+        return ConverterUtil.convertToString((BigInteger)o);
     }
 }

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeLongPopulateTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeLongPopulateTest.java?rev=349959&r1=349958&r2=349959&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeLongPopulateTest.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeLongPopulateTest.java Wed Nov 30 06:46:04 2005
@@ -1,5 +1,7 @@
 package org.apache.axis2.databinding.schema.populate.derived;
 
+import org.apache.axis2.databinding.schema.util.ConverterUtil;
+
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -17,15 +19,39 @@
  */
 
 public class DerivedTypeLongPopulateTest extends AbstractDerivedPopulater{
+
+    private String values[]= {
+            "17578283282",
+            "-1228284443",
+            "2",
+            Long.MAX_VALUE + "",
+            Long.MIN_VALUE + ""
+    };
+
     private String xmlString[] = {
-            "<DerivedLong>17578283282</DerivedLong>",
-            "<DerivedLong>-1228284443</DerivedLong>",
-            "<DerivedLong>2</DerivedLong>"
+            "<DerivedLong>"+values[0]+"</DerivedLong>",
+            "<DerivedLong>"+values[1]+"</DerivedLong>",
+            "<DerivedLong>"+values[2]+"</DerivedLong>",
+            "<DerivedLong>"+values[3]+"</DerivedLong>",
+            "<DerivedLong>"+values[4]+"</DerivedLong>"
     };
+
+
+
+
+    protected void setUp() throws Exception {
+        className = "org.soapinterop.DerivedLong";
+        propertyClass = long.class;
+    }
+
     // force others to implement this method
     public void testPopulate() throws Exception {
-        process(xmlString[0],"org.soapinterop.DerivedLong");
-        process(xmlString[1],"org.soapinterop.DerivedLong");
-        process(xmlString[2],"org.soapinterop.DerivedLong");
+        for (int i = 0; i < 2; i++) {
+            checkValue(xmlString[i],values[i]);
+        }
+    }
+
+    protected String convertToString(Object o) {
+        return ConverterUtil.convertToString((Long)o);
     }
 }

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeNegativeIntegerPopulateTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeNegativeIntegerPopulateTest.java?rev=349959&r1=349958&r2=349959&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeNegativeIntegerPopulateTest.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeNegativeIntegerPopulateTest.java Wed Nov 30 06:46:04 2005
@@ -1,5 +1,8 @@
 package org.apache.axis2.databinding.schema.populate.derived;
 
+import org.apache.axis2.databinding.schema.util.ConverterUtil;
+import org.apache.axis2.databinding.schema.types.NegativeInteger;
+
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -17,27 +20,45 @@
  */
 
 public class DerivedTypeNegativeIntegerPopulateTest extends AbstractDerivedPopulater{
+    
+     private String values[]= {
+            "-18443",
+            "-1",
+            "-2633",
+            "267582233",
+            "0",
+    };
     private String xmlString[] = {
-            "<DerivedNegativeInteger>-18443</DerivedNegativeInteger>",
-            "<DerivedNegativeInteger>-1</DerivedNegativeInteger>",
-            "<DerivedNegativeInteger>-2633</DerivedNegativeInteger>",
-            "<DerivedNegativeInteger>267582233</DerivedNegativeInteger>",
-            "<DerivedNegativeInteger>0</DerivedNegativeInteger>"
+            "<DerivedNegativeInteger>"+values[0]+"</DerivedNegativeInteger>",
+            "<DerivedNegativeInteger>"+values[1]+"</DerivedNegativeInteger>",
+            "<DerivedNegativeInteger>"+values[2]+"</DerivedNegativeInteger>",
+            "<DerivedNegativeInteger>"+values[3]+"</DerivedNegativeInteger>",
+            "<DerivedNegativeInteger>"+values[4]+"</DerivedNegativeInteger>"
     };
+
+    protected void setUp() throws Exception {
+        className = "org.soapinterop.DerivedNegativeInteger";
+        propertyClass = NegativeInteger.class;
+    }
+
     // force others to implement this method
     public void testPopulate() throws Exception {
-        process(xmlString[0],"org.soapinterop.DerivedNegativeInteger");
-        process(xmlString[1],"org.soapinterop.DerivedNegativeInteger");
-        process(xmlString[2],"org.soapinterop.DerivedNegativeInteger");
-
-        try {
-            process(xmlString[3],"org.soapinterop.DerivedNegativeInteger");
-            fail();
-        } catch (Exception e) {}
-
-        try {
-            process(xmlString[4],"org.soapinterop.DerivedNegativeInteger");
-            fail();
-        } catch (Exception e) {}
+        for (int i = 0; i < 3; i++) {
+            checkValue(xmlString[i],values[i]);
+        }
+
+        for (int i = 3; i < values.length; i++) {
+            try {
+                checkValue(xmlString[i],values[i]);
+                fail();
+            } catch (Exception e) {
+
+            }
+        }
+
+    }
+
+    protected String convertToString(Object o) {
+        return ConverterUtil.convertToString((NegativeInteger)o);
     }
 }

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeNonNegativeIntegerPopulateTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeNonNegativeIntegerPopulateTest.java?rev=349959&r1=349958&r2=349959&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeNonNegativeIntegerPopulateTest.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeNonNegativeIntegerPopulateTest.java Wed Nov 30 06:46:04 2005
@@ -1,5 +1,8 @@
 package org.apache.axis2.databinding.schema.populate.derived;
 
+import org.apache.axis2.databinding.schema.util.ConverterUtil;
+import org.apache.axis2.databinding.schema.types.NonNegativeInteger;
+
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -17,22 +20,49 @@
  */
 
 public class DerivedTypeNonNegativeIntegerPopulateTest extends AbstractDerivedPopulater{
+
+    private String values[]= {
+            "18444",
+            "1",
+            "0" ,
+            "-1" ,
+            "-3453434"
+
+    };
+
     private String xmlString[] = {
-            "<DerivedNonNegativeInteger>18443</DerivedNonNegativeInteger>",
-            "<DerivedNonNegativeInteger>1</DerivedNonNegativeInteger>",
-            "<DerivedNonNegativeInteger>0</DerivedNonNegativeInteger>",
-            "<DerivedNonNegativeInteger>-267582233</DerivedNonNegativeInteger>"
+            "<DerivedNonNegativeInteger>"+values[0]+"</DerivedNonNegativeInteger>",
+            "<DerivedNonNegativeInteger>"+values[1]+"</DerivedNonNegativeInteger>",
+            "<DerivedNonNegativeInteger>"+values[2]+"</DerivedNonNegativeInteger>",
+            "<DerivedNonNegativeInteger>"+values[3]+"</DerivedNonNegativeInteger>",
+            "<DerivedNonNegativeInteger>"+values[4]+"</DerivedNonNegativeInteger>"
     };
+
+
+
+
+    protected void setUp() throws Exception {
+        className = "org.soapinterop.DerivedNonNegativeInteger";
+        propertyClass = NonNegativeInteger.class;
+    }
+
     // force others to implement this method
     public void testPopulate() throws Exception {
-        process(xmlString[0],"org.soapinterop.DerivedNonNegativeInteger");
-        process(xmlString[1],"org.soapinterop.DerivedNonNegativeInteger");
-        process(xmlString[2],"org.soapinterop.DerivedNonNegativeInteger");
-
-        try {
-            process(xmlString[3],"org.soapinterop.DerivedNonNegativeInteger");
-            fail();
-        } catch (Exception e) {}
 
+        for (int i = 0; i < 3; i++) {
+            checkValue(xmlString[i],values[i]);
+        }
+        for (int i = 3; i < values.length; i++) {
+            try {
+                checkValue(xmlString[i],values[i]);
+                fail();
+            } catch (Exception e) {
+
+            }
+        }
+    }
+
+    protected String convertToString(Object o) {
+        return ConverterUtil.convertToString((NonNegativeInteger)o);
     }
 }

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeNonPositiveIntegerPopulateTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeNonPositiveIntegerPopulateTest.java?rev=349959&r1=349958&r2=349959&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeNonPositiveIntegerPopulateTest.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeNonPositiveIntegerPopulateTest.java Wed Nov 30 06:46:04 2005
@@ -1,5 +1,9 @@
 package org.apache.axis2.databinding.schema.populate.derived;
 
+import org.apache.axis2.databinding.schema.util.ConverterUtil;
+import org.apache.axis2.databinding.schema.types.NonNegativeInteger;
+import org.apache.axis2.databinding.schema.types.NonPositiveInteger;
+
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -17,23 +21,49 @@
  */
 
 public class DerivedTypeNonPositiveIntegerPopulateTest extends AbstractDerivedPopulater{
+
+    private String values[]= {
+            "-18444",
+            "-1",
+            "0" ,
+            "1" ,
+            "3453434"
+
+    };
+
     private String xmlString[] = {
-            "<DerivedNonPositiveInteger>-18443</DerivedNonPositiveInteger>",
-            "<DerivedNonPositiveInteger>-1</DerivedNonPositiveInteger>",
-            "<DerivedNonPositiveInteger>0</DerivedNonPositiveInteger>",
-            "<DerivedNonPositiveInteger>267582233</DerivedNonPositiveInteger>"
+            "<DerivedNonPositiveInteger>"+values[0]+"</DerivedNonPositiveInteger>",
+            "<DerivedNonPositiveInteger>"+values[1]+"</DerivedNonPositiveInteger>",
+            "<DerivedNonPositiveInteger>"+values[2]+"</DerivedNonPositiveInteger>",
+            "<DerivedNonPositiveInteger>"+values[3]+"</DerivedNonPositiveInteger>",
+            "<DerivedNonPositiveInteger>"+values[4]+"</DerivedNonPositiveInteger>"
     };
+
+
+
+
+    protected void setUp() throws Exception {
+        className = "org.soapinterop.DerivedNonPositiveInteger";
+        propertyClass = long.class;
+    }
+
     // force others to implement this method
     public void testPopulate() throws Exception {
-        process(xmlString[0],"org.soapinterop.DerivedNonPositiveInteger");
-        process(xmlString[1],"org.soapinterop.DerivedNonPositiveInteger");
-        process(xmlString[2],"org.soapinterop.DerivedNonPositiveInteger");
-
-        try {
-            process(xmlString[3],"org.soapinterop.DerivedNonPositiveInteger");
-            fail();
-        } catch (Exception e) {}
 
-       
+        for (int i = 0; i < 3; i++) {
+            checkValue(xmlString[i],values[i]);
+        }
+        for (int i = 3; i < values.length; i++) {
+            try {
+                checkValue(xmlString[i],values[i]);
+                fail();
+            } catch (Exception e) {
+
+            }
+        }
+    }
+
+    protected String convertToString(Object o) {
+        return ConverterUtil.convertToString((NonPositiveInteger)o);
     }
 }

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypePositveIntegerPopulateTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypePositveIntegerPopulateTest.java?rev=349959&r1=349958&r2=349959&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypePositveIntegerPopulateTest.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypePositveIntegerPopulateTest.java Wed Nov 30 06:46:04 2005
@@ -1,5 +1,9 @@
 package org.apache.axis2.databinding.schema.populate.derived;
 
+import org.apache.axis2.databinding.schema.util.ConverterUtil;
+import org.apache.axis2.databinding.schema.types.NonPositiveInteger;
+import org.apache.axis2.databinding.schema.types.PositiveInteger;
+
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -17,27 +21,49 @@
  */
 
 public class DerivedTypePositveIntegerPopulateTest extends AbstractDerivedPopulater{
+
+     private String values[]= {
+            "18444",
+            "1",
+            "5636332" ,
+            "0" ,
+            "-3453434"
+
+    };
+
     private String xmlString[] = {
-            "<DerivedPositiveInteger>18443</DerivedPositiveInteger>",
-            "<DerivedPositiveInteger>1</DerivedPositiveInteger>",
-            "<DerivedPositiveInteger>2633</DerivedPositiveInteger>",
-            "<DerivedPositiveInteger>-267582233</DerivedPositiveInteger>",
-            "<DerivedPositiveInteger>0</DerivedPositiveInteger>"
+            "<DerivedPositiveInteger>"+values[0]+"</DerivedPositiveInteger>",
+            "<DerivedPositiveInteger>"+values[1]+"</DerivedPositiveInteger>",
+            "<DerivedPositiveInteger>"+values[2]+"</DerivedPositiveInteger>",
+            "<DerivedPositiveInteger>"+values[3]+"</DerivedPositiveInteger>",
+            "<DerivedPositiveInteger>"+values[4]+"</DerivedPositiveInteger>"
     };
+
+
+
+
+    protected void setUp() throws Exception {
+        className = "org.soapinterop.DerivedPositiveInteger";
+        propertyClass = PositiveInteger.class;
+    }
+
     // force others to implement this method
     public void testPopulate() throws Exception {
-        process(xmlString[0],"org.soapinterop.DerivedPositiveInteger");
-        process(xmlString[1],"org.soapinterop.DerivedPositiveInteger");
-        process(xmlString[2],"org.soapinterop.DerivedPositiveInteger");
-
-        try {
-            process(xmlString[3],"org.soapinterop.DerivedPositiveInteger");
-            fail();
-        } catch (Exception e) {}
-
-        try {
-            process(xmlString[4],"org.soapinterop.DerivedPositiveInteger");
-            fail();
-        } catch (Exception e) {}
+
+        for (int i = 0; i < 3; i++) {
+            checkValue(xmlString[i],values[i]);
+        }
+        for (int i = 3; i < values.length; i++) {
+            try {
+                checkValue(xmlString[i],values[i]);
+                fail();
+            } catch (Exception e) {
+
+            }
+        }
+    }
+
+    protected String convertToString(Object o) {
+        return ConverterUtil.convertToString((PositiveInteger)o);
     }
 }

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeShortPopulateTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeShortPopulateTest.java?rev=349959&r1=349958&r2=349959&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeShortPopulateTest.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeShortPopulateTest.java Wed Nov 30 06:46:04 2005
@@ -1,5 +1,8 @@
 package org.apache.axis2.databinding.schema.populate.derived;
 
+import org.apache.axis2.databinding.schema.util.ConverterUtil;
+import org.apache.axis2.databinding.schema.types.PositiveInteger;
+
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -17,15 +20,42 @@
  */
 
 public class DerivedTypeShortPopulateTest extends AbstractDerivedPopulater{
+        
+    private String values[]= {
+            "17444",
+            "-12343",
+            "2" ,
+            "0" ,
+            "-6"
+
+    };
+
     private String xmlString[] = {
-            "<DerivedShort>17578</DerivedShort>",
-            "<DerivedShort>-12282</DerivedShort>",
-            "<DerivedShort>2</DerivedShort>"
+            "<DerivedShort>"+values[0]+"</DerivedShort>",
+            "<DerivedShort>"+values[1]+"</DerivedShort>",
+            "<DerivedShort>"+values[2]+"</DerivedShort>",
+            "<DerivedShort>"+values[3]+"</DerivedShort>",
+            "<DerivedShort>"+values[4]+"</DerivedShort>"
     };
+
+
+
+
+    protected void setUp() throws Exception {
+        className = "org.soapinterop.DerivedShort";
+        propertyClass = Short.class;
+    }
+
     // force others to implement this method
     public void testPopulate() throws Exception {
-        process(xmlString[0],"org.soapinterop.DerivedShort");
-        process(xmlString[1],"org.soapinterop.DerivedShort");
-        process(xmlString[2],"org.soapinterop.DerivedShort");
+
+        for (int i = 0; i < values.length; i++) {
+            checkValue(xmlString[i],values[i]);
+        }
+
+    }
+
+    protected String convertToString(Object o) {
+        return ConverterUtil.convertToString((Short)o);
     }
 }

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeUnsignedBytePopulateTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeUnsignedBytePopulateTest.java?rev=349959&r1=349958&r2=349959&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeUnsignedBytePopulateTest.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeUnsignedBytePopulateTest.java Wed Nov 30 06:46:04 2005
@@ -1,5 +1,8 @@
 package org.apache.axis2.databinding.schema.populate.derived;
 
+import org.apache.axis2.databinding.schema.util.ConverterUtil;
+import org.apache.axis2.databinding.schema.types.UnsignedByte;
+
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -17,23 +20,51 @@
  */
 
 public class DerivedTypeUnsignedBytePopulateTest extends AbstractDerivedPopulater{
+    
+     private String values[]= {
+            "1",
+            "0",
+            "2" ,
+            "-1" ,
+            "-6"
+
+    };
+
     private String xmlString[] = {
-            "<DerivedUnsignedByte>1</DerivedUnsignedByte>",
-            "<DerivedUnsignedByte>0</DerivedUnsignedByte>",
-            "<DerivedUnsignedByte>2</DerivedUnsignedByte>",
-            "<DerivedUnsignedByte>-2</DerivedUnsignedByte>"
+            "<DerivedUnsignedByte>"+values[0]+"</DerivedUnsignedByte>",
+            "<DerivedUnsignedByte>"+values[1]+"</DerivedUnsignedByte>",
+            "<DerivedUnsignedByte>"+values[2]+"</DerivedUnsignedByte>",
+            "<DerivedUnsignedByte>"+values[3]+"</DerivedUnsignedByte>",
+            "<DerivedUnsignedByte>"+values[4]+"</DerivedUnsignedByte>"
     };
+
+
+
+
+    protected void setUp() throws Exception {
+        className = "org.soapinterop.DerivedUnsignedByte";
+        propertyClass = UnsignedByte.class;
+    }
+
     // force others to implement this method
     public void testPopulate() throws Exception {
-        process(xmlString[0],"org.soapinterop.DerivedUnsignedByte");
-        process(xmlString[1],"org.soapinterop.DerivedUnsignedByte");
-        process(xmlString[2],"org.soapinterop.DerivedUnsignedByte");
-
-        try {
-            process(xmlString[3],"org.soapinterop.DerivedUnsignedByte");
-            fail();
-        } catch (Exception e) {
 
+        for (int i = 0; i < 3; i++) {
+            checkValue(xmlString[i],values[i]);
         }
+
+        for (int i = 3; i < values.length; i++) {
+            try {
+                checkValue(xmlString[i],values[i]);
+                fail();
+            } catch (Exception e) {
+
+            }
+        }
+
+    }
+
+    protected String convertToString(Object o) {
+        return ConverterUtil.convertToString((UnsignedByte)o);
     }
 }

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeUnsignedIntPopulateTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeUnsignedIntPopulateTest.java?rev=349959&r1=349958&r2=349959&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeUnsignedIntPopulateTest.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeUnsignedIntPopulateTest.java Wed Nov 30 06:46:04 2005
@@ -1,5 +1,9 @@
 package org.apache.axis2.databinding.schema.populate.derived;
 
+import org.apache.axis2.databinding.schema.types.UnsignedByte;
+import org.apache.axis2.databinding.schema.types.UnsignedInt;
+import org.apache.axis2.databinding.schema.util.ConverterUtil;
+
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -17,23 +21,51 @@
  */
 
 public class DerivedTypeUnsignedIntPopulateTest extends AbstractDerivedPopulater{
+
+    private String values[]= {
+            "1",
+            "0",
+            "267582233" ,
+            "-1" ,
+            "-267582233"
+
+    };
+
     private String xmlString[] = {
-            "<DerivedUnsignedInt>1</DerivedUnsignedInt>",
-            "<DerivedUnsignedInt>0</DerivedUnsignedInt>",
-            "<DerivedUnsignedInt>267582233</DerivedUnsignedInt>",
-            "<DerivedUnsignedInt>-267582233</DerivedUnsignedInt>"
+            "<DerivedUnsignedInt>"+values[0]+"</DerivedUnsignedInt>",
+            "<DerivedUnsignedInt>"+values[1]+"</DerivedUnsignedInt>",
+            "<DerivedUnsignedInt>"+values[2]+"</DerivedUnsignedInt>",
+            "<DerivedUnsignedInt>"+values[3]+"</DerivedUnsignedInt>",
+            "<DerivedUnsignedInt>"+values[4]+"</DerivedUnsignedInt>"
     };
+
+
+
+
+    protected void setUp() throws Exception {
+        className = "org.soapinterop.DerivedUnsignedInt";
+        propertyClass = UnsignedInt.class;
+    }
+
     // force others to implement this method
     public void testPopulate() throws Exception {
-        process(xmlString[0],"org.soapinterop.DerivedUnsignedInt");
-        process(xmlString[1],"org.soapinterop.DerivedUnsignedInt");
-        process(xmlString[2],"org.soapinterop.DerivedUnsignedInt");
-
-        try {
-            process(xmlString[3],"org.soapinterop.DerivedUnsignedInt");
-            fail();
-        } catch (Exception e) {
 
+        for (int i = 0; i < 3; i++) {
+            checkValue(xmlString[i],values[i]);
         }
+
+        for (int i = 3; i < values.length; i++) {
+            try {
+                checkValue(xmlString[i],values[i]);
+                fail();
+            } catch (Exception e) {
+
+            }
+        }
+
+    }
+
+    protected String convertToString(Object o) {
+        return ConverterUtil.convertToString((UnsignedInt)o);
     }
 }

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeUnsignedLongPopulateTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeUnsignedLongPopulateTest.java?rev=349959&r1=349958&r2=349959&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeUnsignedLongPopulateTest.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeUnsignedLongPopulateTest.java Wed Nov 30 06:46:04 2005
@@ -1,5 +1,9 @@
 package org.apache.axis2.databinding.schema.populate.derived;
 
+import org.apache.axis2.databinding.schema.types.UnsignedByte;
+import org.apache.axis2.databinding.schema.types.UnsignedLong;
+import org.apache.axis2.databinding.schema.util.ConverterUtil;
+
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -17,23 +21,51 @@
  */
 
 public class DerivedTypeUnsignedLongPopulateTest extends AbstractDerivedPopulater{
+
+    private String values[]= {
+            "1",
+            "0",
+            "26758223334334" ,
+            "-1" ,
+            "-267582233"
+
+    };
+
     private String xmlString[] = {
-            "<DerivedUnsignedLong>18443</DerivedUnsignedLong>",
-            "<DerivedUnsignedLong>0</DerivedUnsignedLong>",
-            "<DerivedUnsignedLong>2633</DerivedUnsignedLong>",
-            "<DerivedUnsignedLong>-267582233</DerivedUnsignedLong>"
+            "<DerivedUnsignedLong>"+values[0]+"</DerivedUnsignedLong>",
+            "<DerivedUnsignedLong>"+values[1]+"</DerivedUnsignedLong>",
+            "<DerivedUnsignedLong>"+values[2]+"</DerivedUnsignedLong>",
+            "<DerivedUnsignedLong>"+values[3]+"</DerivedUnsignedLong>",
+            "<DerivedUnsignedLong>"+values[4]+"</DerivedUnsignedLong>"
     };
+
+
+
+
+    protected void setUp() throws Exception {
+        className = "org.soapinterop.DerivedUnsignedLong";
+        propertyClass = UnsignedLong.class;
+    }
+
     // force others to implement this method
     public void testPopulate() throws Exception {
-        process(xmlString[0],"org.soapinterop.DerivedUnsignedLong");
-        process(xmlString[1],"org.soapinterop.DerivedUnsignedLong");
-        process(xmlString[2],"org.soapinterop.DerivedUnsignedLong");
-
-        try {
-            process(xmlString[3],"org.soapinterop.DerivedUnsignedLong");
-            fail();
-        } catch (Exception e) {
 
+        for (int i = 0; i < 3; i++) {
+            checkValue(xmlString[i],values[i]);
         }
+
+        for (int i = 3; i < values.length; i++) {
+            try {
+                checkValue(xmlString[i],values[i]);
+                fail();
+            } catch (Exception e) {
+
+            }
+        }
+
+    }
+
+    protected String convertToString(Object o) {
+        return ConverterUtil.convertToString((UnsignedLong)o);
     }
 }

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeUnsignedShortPopulateTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeUnsignedShortPopulateTest.java?rev=349959&r1=349958&r2=349959&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeUnsignedShortPopulateTest.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/derived/DerivedTypeUnsignedShortPopulateTest.java Wed Nov 30 06:46:04 2005
@@ -1,5 +1,9 @@
 package org.apache.axis2.databinding.schema.populate.derived;
 
+import org.apache.axis2.databinding.schema.types.UnsignedLong;
+import org.apache.axis2.databinding.schema.types.UnsignedShort;
+import org.apache.axis2.databinding.schema.util.ConverterUtil;
+
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -17,23 +21,51 @@
  */
 
 public class DerivedTypeUnsignedShortPopulateTest extends AbstractDerivedPopulater{
+
+    private String values[]= {
+            "1",
+            "0",
+            "2675" ,
+            "-1" ,
+            "-2675823"
+
+    };
+
     private String xmlString[] = {
-            "<DerivedUnsignedShort>18443</DerivedUnsignedShort>",
-            "<DerivedUnsignedShort>0</DerivedUnsignedShort>",
-            "<DerivedUnsignedShort>2633</DerivedUnsignedShort>",
-            "<DerivedUnsignedShort>-267582233</DerivedUnsignedShort>"
+            "<DerivedUnsignedShort>"+values[0]+"</DerivedUnsignedShort>",
+            "<DerivedUnsignedShort>"+values[1]+"</DerivedUnsignedShort>",
+            "<DerivedUnsignedShort>"+values[2]+"</DerivedUnsignedShort>",
+            "<DerivedUnsignedShort>"+values[3]+"</DerivedUnsignedShort>",
+            "<DerivedUnsignedShort>"+values[4]+"</DerivedUnsignedShort>"
     };
+
+
+
+
+    protected void setUp() throws Exception {
+        className = "org.soapinterop.DerivedUnsignedShort";
+        propertyClass = UnsignedShort.class;
+    }
+
     // force others to implement this method
     public void testPopulate() throws Exception {
-        process(xmlString[0],"org.soapinterop.DerivedUnsignedShort");
-        process(xmlString[1],"org.soapinterop.DerivedUnsignedShort");
-        process(xmlString[2],"org.soapinterop.DerivedUnsignedShort");
-
-        try {
-            process(xmlString[3],"org.soapinterop.DerivedUnsignedShort");
-            fail();
-        } catch (Exception e) {
 
+        for (int i = 0; i < 3; i++) {
+            checkValue(xmlString[i],values[i]);
         }
+
+        for (int i = 3; i < values.length; i++) {
+            try {
+                checkValue(xmlString[i],values[i]);
+                fail();
+            } catch (Exception e) {
+
+            }
+        }
+
+    }
+
+    protected String convertToString(Object o) {
+        return ConverterUtil.convertToString((UnsignedShort)o);
     }
 }

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/SimpleTypeHexBinaryPopulateTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/SimpleTypeHexBinaryPopulateTest.java?rev=349959&r1=349958&r2=349959&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/SimpleTypeHexBinaryPopulateTest.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/SimpleTypeHexBinaryPopulateTest.java Wed Nov 30 06:46:04 2005
@@ -1,4 +1,8 @@
 package org.apache.axis2.databinding.schema.populate.simple;
+
+import org.apache.axis2.databinding.schema.types.Year;
+import org.apache.axis2.databinding.schema.types.HexBinary;
+import org.apache.axis2.databinding.schema.util.ConverterUtil;
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -16,13 +20,35 @@
  */
 
 public class SimpleTypeHexBinaryPopulateTest extends AbstractSimplePopulater{
+
+    private String values[]= {
+            "0FB7",
+            "FFFFFFFF",
+            "1978"
+    };
     private String xmlString[] = {
-            "<hexBinParam>0FB7</hexBinParam>",
-            "<hexBinParam>FFFFFFFF</hexBinParam>",
+            "<hexBinParam>"+values[0]+"</hexBinParam>",
+            "<hexBinParam>"+values[1]+"</hexBinParam>",
+            "<hexBinParam>"+values[2]+"</hexBinParam>"
     };
+
+    protected void setUp() throws Exception {
+        className = "org.soapinterop.hexBinParam";
+        propertyClass = HexBinary.class;
+    }
+
     // force others to implement this method
     public void testPopulate() throws Exception {
-        process(xmlString[0],"org.soapinterop.hexBinParam");
-        process(xmlString[1],"org.soapinterop.hexBinParam");
+        for (int i = 0; i < 2; i++) {
+            checkValue(xmlString[i],values[i]);
+        }
+    }
+
+    protected String convertToString(Object o) {
+        return ConverterUtil.convertToString((HexBinary)o);
+    }
+
+    protected void compare(String val1, String val2) {
+       assertTrue(val1.equalsIgnoreCase(val2));
     }
 }

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/SimpleTypeMonthDayPopulateTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/SimpleTypeMonthDayPopulateTest.java?rev=349959&r1=349958&r2=349959&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/SimpleTypeMonthDayPopulateTest.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/SimpleTypeMonthDayPopulateTest.java Wed Nov 30 06:46:04 2005
@@ -1,4 +1,8 @@
 package org.apache.axis2.databinding.schema.populate.simple;
+
+import org.apache.axis2.databinding.schema.types.HexBinary;
+import org.apache.axis2.databinding.schema.types.MonthDay;
+import org.apache.axis2.databinding.schema.util.ConverterUtil;
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -16,15 +20,32 @@
  */
 
 public class SimpleTypeMonthDayPopulateTest extends AbstractSimplePopulater{
+
+    private String values[]= {
+            "--05-12",
+            "--06-30",
+            "--12-31"
+    };
     private String xmlString[] = {
-            "<monthDayParam>--05-12</monthDayParam>",
-            "<monthDayParam>--06-30</monthDayParam>",
-            "<monthDayParam>--12-31+05:00</monthDayParam>"
+            "<monthDayParam>"+values[0]+"</monthDayParam>",
+            "<monthDayParam>"+values[1]+"</monthDayParam>",
+            "<monthDayParam>"+values[2]+"</monthDayParam>"
     };
+
+    protected void setUp() throws Exception {
+        className = "org.soapinterop.monthDayParam";
+        propertyClass = MonthDay.class;
+    }
+
     // force others to implement this method
     public void testPopulate() throws Exception {
-        process(xmlString[0],"org.soapinterop.monthDayParam");
-        process(xmlString[1],"org.soapinterop.monthDayParam");
-        process(xmlString[2],"org.soapinterop.monthDayParam");
+        for (int i = 0; i < 2; i++) {
+            checkValue(xmlString[i],values[i]);
+        }
+    }
+
+    protected String convertToString(Object o) {
+        return ConverterUtil.convertToString((MonthDay)o);
     }
+
 }

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/SimpleTypeTimePopulateTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/SimpleTypeTimePopulateTest.java?rev=349959&r1=349958&r2=349959&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/SimpleTypeTimePopulateTest.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/SimpleTypeTimePopulateTest.java Wed Nov 30 06:46:04 2005
@@ -1,4 +1,8 @@
 package org.apache.axis2.databinding.schema.populate.simple;
+
+import org.apache.axis2.databinding.schema.types.MonthDay;
+import org.apache.axis2.databinding.schema.types.Time;
+import org.apache.axis2.databinding.schema.util.ConverterUtil;
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -16,15 +20,38 @@
  */
 
 public class SimpleTypeTimePopulateTest extends AbstractSimplePopulater{
+    private String values[]= {
+            "13:20:00",
+            "23:59:59"
+    };
     private String xmlString[] = {
-            "<timeParam>13:20:00-05:00</timeParam>",
-            "<timeParam>13:20:00</timeParam>",
-            "<timeParam>23:59:59-05:00</timeParam>"
+            "<timeParam>"+values[0]+"</timeParam>",
+            "<timeParam>"+values[1]+"</timeParam>",
     };
+
+    protected void setUp() throws Exception {
+        className = "org.soapinterop.timeParam";
+        propertyClass = Time.class;
+    }
+
     // force others to implement this method
     public void testPopulate() throws Exception {
-        process(xmlString[0],"org.soapinterop.timeParam");
-        process(xmlString[1],"org.soapinterop.timeParam");
-        process(xmlString[2],"org.soapinterop.timeParam");
+        for (int i = 0; i < 2; i++) {
+            checkValue(xmlString[i],values[i]);
+        }
     }
+
+    protected String convertToString(Object o) {
+        return ConverterUtil.convertToString((Time)o);
+    }
+
+    protected void compare(String val1, String val2) {
+        //todo - Find a propr way to compare these time strings
+        //check for null for now
+        assertNotNull(val1);
+        assertNotNull(val2);
+        //assertTrue(new Time(val1).equals(new Time(val2)));
+
+    }
+
 }



Mime
View raw message