import static org.junit.Assert.assertTrue;\r
\r
import java.math.BigDecimal;\r
+import java.text.DecimalFormat;\r
import java.util.Collections;\r
import java.util.HashSet;\r
import java.util.List;\r
\r
@Override\r
public String toString() {\r
- return customerId + ":" + orderId + ":" + total;\r
+ return customerId + ":" + orderId + ":" + new DecimalFormat("##.00").format(total);\r
}\r
}\r
\r
import java.io.Serializable;
import java.math.BigDecimal;
+import java.math.MathContext;
import java.math.RoundingMode;
import java.text.SimpleDateFormat;
import java.util.Arrays;
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)));