svn commit: r959456 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r959456 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java

adrianc
Author: adrianc
Date: Wed Jun 30 22:05:04 2010
New Revision: 959456

URL: http://svn.apache.org/viewvc?rev=959456&view=rev
Log:
Entity field test improvements - made them compatible with a broader range of databases.

Modified:
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java?rev=959456&r1=959455&r2=959456&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java Wed Jun 30 22:05:04 2010
@@ -506,9 +506,13 @@ public class EntityTestSuite extends Ent
         long currentMillis = System.currentTimeMillis();
         Date currentDate = Date.valueOf(new Date(currentMillis).toString());
         Time currentTime = Time.valueOf(new Time(currentMillis).toString());
-        Timestamp currentTimestamp = new Timestamp(currentMillis);
+        // Different databases have different precision for Timestamps, so
+        // we will ignore fractional seconds.
+        Timestamp currentTimestamp = new Timestamp(currentDate.getTime());
         BigDecimal fixedPoint = new BigDecimal("999999999999.999999");
-        Double floatingPoint = Double.MAX_VALUE / 2;
+        // Different databases have different precision for floating
+        // point types, so we will use a simple decimal number.
+        Double floatingPoint = 1.0123456789;
         Long numeric = Long.MAX_VALUE;
         try {
             GenericValue testValue = delegator.makeValue("TestFieldType", "testFieldTypeId", id);