tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kelvingood...@apache.org
Subject svn commit: r481244 - in /incubator/tuscany/java/sdo/impl/src: main/java/org/apache/tuscany/sdo/util/DataObjectUtil.java test/java/org/apache/tuscany/sdo/test/TypeConversionTestCase.java
Date Fri, 01 Dec 2006 13:47:19 GMT
Author: kelvingoodson
Date: Fri Dec  1 05:47:18 2006
New Revision: 481244

URL: http://svn.apache.org/viewvc?view=rev&rev=481244
Log:
TUSCANY-836 fix and test

Modified:
    incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/DataObjectUtil.java
    incubator/tuscany/java/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/TypeConversionTestCase.java

Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/DataObjectUtil.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/DataObjectUtil.java?view=diff&rev=481244&r1=481243&r2=481244
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/DataObjectUtil.java
(original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/DataObjectUtil.java
Fri Dec  1 05:47:18 2006
@@ -792,6 +792,11 @@
     {
       return new BigDecimal((BigInteger)value);
     }
+    
+    if (value instanceof Long)
+    {
+      return new BigDecimal(((Long)value).longValue());
+    } 
 
     if (value instanceof Number)
     {

Modified: incubator/tuscany/java/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/TypeConversionTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/TypeConversionTestCase.java?view=diff&rev=481244&r1=481243&r2=481244
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/TypeConversionTestCase.java
(original)
+++ incubator/tuscany/java/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/TypeConversionTestCase.java
Fri Dec  1 05:47:18 2006
@@ -33,6 +33,8 @@
 import java.util.Date;
 import java.util.TimeZone;
 
+import org.apache.tuscany.sdo.util.DataObjectUtil;
+
 import commonj.sdo.DataObject;
 import commonj.sdo.Property;
 import commonj.sdo.Type;
@@ -879,5 +881,9 @@
         FromDate.checkConversionException(TO_DATAOBJECT, ClassCastException.class);
         FromDate.checkConversionException(TO_LIST, ClassCastException.class);
         FromDate.checkConversionException(TO_SEQUENCE, ClassCastException.class);
+    }
+    
+    public void testTuscany_836() {
+        assertEquals(DataObjectUtil.getBigDecimal(new Long(Long.MAX_VALUE)).longValue(),
Long.MAX_VALUE);
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message