assertNotNull(testRead.getDateColumn());
assertEquals(nowDate, testRead.getDateColumn());
}
public void testTime() throws Exception {
DateTestEntity test = (DateTestEntity) context.newObject("DateTestEntity");
Calendar cal = Calendar.getInstance();
cal.clear();
cal.set(1970, 0, 1, 1, 20, 30);
Date nowTime = cal.getTime();
test.setTimeColumn(nowTime);
context.commitChanges();
SelectQuery q = new SelectQuery(DateTestEntity.class);
DateTestEntity testRead = (DateTestEntity) context.performQuery(q).get(0);
assertNotNull(testRead.getTimeColumn());
// OpenBase fails to store seconds for the time
// FrontBase returns time with 1 hour offset (I guess "TIME WITH TIMEZONE" may
// need to be used as a default FB type?)
// so this test is approximate...
long delta = nowTime.getTime() - testRead.getTimeColumn().getTime();
assertTrue("" + delta, Math.abs(delta) <= 1000 * 60 * 60);
}