aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/test/java/com/iciql/test/SamplesTest.java3
-rw-r--r--src/test/java/com/iciql/test/models/SupportedTypes.java6
2 files changed, 7 insertions, 2 deletions
diff --git a/src/test/java/com/iciql/test/SamplesTest.java b/src/test/java/com/iciql/test/SamplesTest.java
index df6d219..dbbf97f 100644
--- a/src/test/java/com/iciql/test/SamplesTest.java
+++ b/src/test/java/com/iciql/test/SamplesTest.java
@@ -28,6 +28,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.math.BigDecimal;
+import java.text.DecimalFormat;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
@@ -214,7 +215,7 @@ public class SamplesTest {
@Override
public String toString() {
- return customerId + ":" + orderId + ":" + total;
+ return customerId + ":" + orderId + ":" + new DecimalFormat("##.00").format(total);
}
}
diff --git a/src/test/java/com/iciql/test/models/SupportedTypes.java b/src/test/java/com/iciql/test/models/SupportedTypes.java
index 489650e..d9a6405 100644
--- a/src/test/java/com/iciql/test/models/SupportedTypes.java
+++ b/src/test/java/com/iciql/test/models/SupportedTypes.java
@@ -19,6 +19,7 @@ package com.iciql.test.models;
import java.io.Serializable;
import java.math.BigDecimal;
+import java.math.MathContext;
import java.math.RoundingMode;
import java.text.SimpleDateFormat;
import java.util.Arrays;
@@ -178,7 +179,10 @@ public class SupportedTypes implements Serializable {
same &= same("myLong", myLong.equals(s.myLong));
same &= same("myFloat", IciqlSuite.equivalentTo(myFloat, s.myFloat));
same &= same("myDouble", IciqlSuite.equivalentTo(myDouble, s.myDouble));
- same &= same("myBigDecimal", myBigDecimal.compareTo(s.myBigDecimal) == 0);
+
+ BigDecimal bda = myBigDecimal.round(MathContext.DECIMAL32);
+ BigDecimal bdb = s.myBigDecimal.round(MathContext.DECIMAL32);
+ same &= same("myBigDecimal", bda.compareTo(bdb) == 0);
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
same &= same("myUtilDate", df.format(myUtilDate).equals(df.format(s.myUtilDate)));