};
PersistenceManager pm = pmf.getPersistenceManager();
for (int i = 0; i < listeners.length; i++) {
pmf.addInstanceLifecycleListener(listeners[i], new Class[]{BasicA.class});
}
BasicA ba = new BasicA();
assertEquals("unexpect event on create ", 0, nbEvent[0]);
ba.writeF1("testInstanceLifecycleListener_1");
assertEquals("unexpect event on write ", 0, nbEvent[0]);
pm.currentTransaction().begin();
pm.makePersistent(ba);
assertEquals("Bad event number on make persistent: ", 1, nbEvent[0]);
ba.writeF1("testInstanceLifecycleListener_1");
assertEquals("Bad event number on make persistent after write: ", 3, nbEvent[0]);
assertNotNull("Not postCreate event", marks[InstanceLifecycleEvent.CREATE][POST]);
assertTrue("Bad source ", marks[InstanceLifecycleEvent.CREATE][POST].getSource() == ba);
clear(nbEvent, marks);
pm.currentTransaction().commit();
pm.currentTransaction().begin();
assertTrue("Bad event number on commit: " + nbEvent[0], 2 == nbEvent[0] | 3 ==nbEvent[0]);
assertNotNull("Not preStore event", marks[InstanceLifecycleEvent.STORE][PRE]);
assertTrue("Bad source on preStore", marks[InstanceLifecycleEvent.STORE][PRE].getSource() == ba);
assertNotNull("Not postStore event", marks[InstanceLifecycleEvent.STORE][POST]);
assertTrue("Bad source on postStore", marks[InstanceLifecycleEvent.STORE][POST].getSource() == ba);
pm.currentTransaction().commit();
pm.evict(ba);
pm.currentTransaction().begin();
clear(nbEvent, marks);
assertEquals("Bad f1 value" , "testInstanceLifecycleListener_1", ba.readF1());
assertTrue("Bad event number on load: ", 2 == nbEvent[0] || 1 == nbEvent[0]);
assertNotNull("Not postStore event", marks[InstanceLifecycleEvent.LOAD][POST]);
assertTrue("Bad source on postStore", marks[InstanceLifecycleEvent.LOAD][POST].getSource() == ba);
/*
nbEvent[0] = 0;