pmfSPI
.addLifecycleListener(listener, new Class[]{ RuntimeTest4.class });
try {
BrokerImpl broker = (BrokerImpl) JPAFacadeHelper.toBroker
(pmf.createEntityManager());
MetaDataRepository repos = broker.getConfiguration().
getMetaDataRepositoryInstance();
assertTrue("no listeners defined added to Runtimetest4",
broker.getLifecycleEventManager().hasLoadListeners(
new RuntimeTest4("foo"),
repos.getMetaData(RuntimeTest4.class, null, true)));
assertFalse("there should be listeners def for runtimetest1",
broker.getLifecycleEventManager().hasLoadListeners
(new RuntimeTest1(), repos.getMetaData
(RuntimeTest1.class, null, true)));
broker.close();
} finally {
pmfSPI.removeLifecycleListener(listener);
}
}