/**
* Tests insert, update and delete
*
*/
public void testIUD() {
Entry e = new Entry();
e.setBody("body");
e.setPostDate(new Date());
e.setSubject("subject");
getDao().save(e);
assertTrue(e.getEntryId() > 0);
Entry e2 = getDao().getById(e.getEntryId());
assertEquals(e.getEntryId(), e2.getEntryId());
assertEquals(e.getBody(), e2.getBody());
assertEquals(e.getSubject(), e2.getSubject());
assertEquals(e.getPostDate().getTime(), e2.getPostDate().getTime(), 1000);
Date newDate = new Date(e.getPostDate().getTime() - 1000);
e2.setSubject("foo");
e2.setBody("bar");
e2.setPostDate(newDate);
getDao().save(e2);
Entry e3 = getDao().getById(e2.getEntryId());
assertEquals(e.getEntryId(), e3.getEntryId());
assertEquals("bar", e3.getBody());
assertEquals("foo", e3.getSubject());
assertEquals(newDate.getTime(), e3.getPostDate().getTime(), 1000);
getDao().delete(e3.getEntryId());
}