Persistence.createEntityManagerFactory("test", props));
EntityManagerImpl em = (EntityManagerImpl)emf.createEntityManager();
BrokerImpl broker = (BrokerImpl) em.getBroker();
DelegatingStoreManager dstore = broker.getStoreManager();
JDBCStoreManager jstore =
(JDBCStoreManager)dstore.getInnermostDelegate();
em.getTransaction().begin();
Person p = new Person();
p.setId(1);
em.persist(p);
em.flush();
em.getTransaction().commit();
Person p1 = em.find(Person.class, 1);
assertTrue(jstore.isQuerySQLCacheOn());
Map sqlCache = jstore.getQuerySQLCache();
Set keys = sqlCache.keySet();
for (Iterator iter = keys.iterator(); iter.hasNext();) {
Map cacheMap = (Map) iter.next();
assertTrue((cacheMap instanceof
org.apache.openjpa.kernel.TestQuerySQLCache.CustomCacheMap));