addReadWriteAccess(CategoryAccounts.class);
final OBCriteria<Category> obc = OBDal.getInstance().createCriteria(Category.class);
obc.add(Expression.eq(Category.PROPERTY_NAME, "hello world"));
final List<Category> bpgs = obc.list();
assertEquals(1, bpgs.size());
final Category bog = bpgs.get(0);
final OBContext obContext = OBContext.getOBContext();
assertEquals(obContext.getUser().getId(), bog.getCreatedBy().getId());
assertEquals(obContext.getUser().getId(), bog.getUpdatedBy().getId());
// update and create have occured less than one second ago
// note that if the delete fails for other reasons that you will have a
// currency in the database which has for sure a created/updated time
// longer in the past, You need to manually delete the currency record
// NOTE: disabled for now as it is to sensitive if there is time between a
// failed testcase and a retry
if (false) {
assertTrue("Created time not updated", (System.currentTimeMillis() - bog.getCreationDate()
.getTime()) < 2000);
assertTrue("Updated time not updated", (System.currentTimeMillis() - bog.getUpdated()
.getTime()) < 2000);
}
// first delete the related accounts
final OBCriteria<CategoryAccounts> obc2 = OBDal.getInstance().createCriteria(