提交 3e78b5b1 编写于 作者: G guolindev

Add testcase for save long maximum number.

上级 3f1e35c9
......@@ -7,6 +7,7 @@ public class IdCard extends LitePalSupport {
private String number;
private String address;
private Student student;
private long serial;
// private Teacher teacher;
/**
......@@ -68,4 +69,11 @@ public class IdCard extends LitePalSupport {
this.student = student;
}
public long getSerial() {
return serial;
}
public void setSerial(long serial) {
this.serial = serial;
}
}
......@@ -235,4 +235,14 @@ public class SaveTest extends LitePalTestCase {
}
}
@Test
public void testSaveLongMaximumNumber() {
IdCard idCard = new IdCard();
idCard.setSerial(Long.MAX_VALUE);
idCard.setAddress("abczyx");
assertTrue(idCard.save());
IdCard idCardFromDB = LitePal.find(IdCard.class, idCard.getId());
assertEquals(Long.MAX_VALUE, idCardFromDB.getSerial());
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册