提交 8f803a37 authored 作者: Thomas Mueller's avatar Thomas Mueller

Tests.

上级 2deb0e7c
...@@ -82,9 +82,11 @@ public class ModelsTest extends TestBase { ...@@ -82,9 +82,11 @@ public class ModelsTest extends TestBase {
for (int i = 0; i < original.size(); i++) { for (int i = 0; i < original.size(); i++) {
SupportedTypes o = original.get(i); SupportedTypes o = original.get(i);
SupportedTypes r = retrieved.get(i); SupportedTypes r = retrieved.get(i);
if (!o.equivalentTo(r)) {
assertTrue(o.equivalentTo(r)); assertTrue(o.equivalentTo(r));
} }
} }
}
private void testModelGeneration() { private void testModelGeneration() {
DbInspector inspector = new DbInspector(db); DbInspector inspector = new DbInspector(db);
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
package org.h2.test.jaqu; package org.h2.test.jaqu;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
import org.h2.jaqu.Table.JQColumn; import org.h2.jaqu.Table.JQColumn;
...@@ -100,11 +101,13 @@ public class SupportedTypes { ...@@ -100,11 +101,13 @@ public class SupportedTypes {
same &= myFloat.equals(s.myFloat); same &= myFloat.equals(s.myFloat);
same &= myDouble.equals(s.myDouble); same &= myDouble.equals(s.myDouble);
same &= myBigDecimal.equals(s.myBigDecimal); same &= myBigDecimal.equals(s.myBigDecimal);
same &= myUtilDate.getTime() == s.myUtilDate.getTime(); Timestamp a = new Timestamp(myUtilDate.getTime());
same &= mySqlTimestamp.getTime() == s.mySqlTimestamp.getTime(); same &= a.toString().equals(s.myUtilDate.toString());
same &= mySqlTimestamp.toString().equals(s.mySqlTimestamp.toString());
same &= mySqlDate.toString().equals(s.mySqlDate.toString()); same &= mySqlDate.toString().equals(s.mySqlDate.toString());
same &= mySqlTime.toString().equals(s.mySqlTime.toString()); same &= mySqlTime.toString().equals(s.mySqlTime.toString());
same &= myString.equals(s.myString); same &= myString.equals(s.myString);
same &= true;
return same; return same;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论