assertEquals(0, listener.load);
assertEquals(0, listener.store);
assertTrue(mgr.hasLoadListeners(pc, meta));
assertTrue(mgr.hasStoreListeners(pc, meta));
assertFalse(mgr.hasDirtyListeners(pc, meta));
assertFalse(mgr.hasLoadListeners(new RuntimeTest4("foo"), meta));
assertEquals(0, listener.load);
assertEquals(0, listener.store);
Listener listener2 = new Listener();
mgr.addListener(listener2, new Class[]{ RuntimeTest2.class });
assertTrue(mgr.hasLoadListeners(pc, meta));
assertTrue(mgr.hasStoreListeners(pc, meta));
assertFalse(mgr.hasDirtyListeners(pc, meta));
assertFalse(mgr.hasLoadListeners(new RuntimeTest4("foo"), meta));
mgr.fireEvent(pc, meta, LifecycleEvent.AFTER_LOAD);
assertEquals(1, listener.load);
assertEquals(0, listener.store);
assertEquals(1, listener2.load);
assertEquals(0, listener2.store);
mgr.fireEvent(pc, meta, LifecycleEvent.AFTER_LOAD);
assertEquals(2, listener.load);
assertEquals(0, listener.store);
assertEquals(2, listener2.load);
assertEquals(0, listener2.store);
mgr.fireEvent(new RuntimeTest1(), meta, LifecycleEvent.AFTER_LOAD);
assertEquals(3, listener.load);
assertEquals(0, listener.store);
assertEquals(2, listener2.load);
assertEquals(0, listener2.store);
mgr.removeListener(listener2);
assertTrue(mgr.hasLoadListeners(pc, meta));
assertTrue(mgr.hasStoreListeners(pc, meta));
mgr.fireEvent(pc, meta, LifecycleEvent.AFTER_STORE);
assertEquals(3, listener.load);
assertEquals(1, listener.store);
assertEquals(2, listener2.load);
assertEquals(0, listener2.store);
mgr.fireEvent(pc, meta, LifecycleEvent.AFTER_DIRTY);
assertEquals(3, listener.load);
assertEquals(1, listener.store);
mgr.fireEvent(new RuntimeTest4("foo"), meta,
LifecycleEvent.AFTER_STORE);
assertEquals(3, listener.load);
assertEquals(1, listener.store);
mgr.removeListener(listener);