try {
String f1 = "testInt";
int name = 13;
Object id;
PersistenceManager pm = pmf.getPersistenceManager();
IntUserId iui = new IntUserId(name, f1);
pm.makePersistent(iui);
id = pm.getObjectId(iui);
Assert.assertNotNull("identifier is null", id);
pm.close();
iui = null; // garbage object
pm = pmf.getPersistenceManager();
id = pm.newObjectIdInstance(IntUserId.class, id.toString());
Assert.assertNotNull("built identifier is null", id);
iui = (IntUserId) pm.getObjectById(id, false);
Assert.assertNotNull("returned object is null", iui);
Assert.assertEquals("Bad field 'name' value", name, iui.getName());
Assert.assertEquals("Bad field 'f1' value", f1, iui.getF1());
pm.currentTransaction().begin();
pm.deletePersistent(iui);
pm.currentTransaction().commit();
pm.close();
} catch (Exception e) {