Map cache = emf.getConfiguration().getQueryCompilationCacheInstance();
cache.clear();
OpenJPAEntityManager em = emf.createEntityManager();
OpenJPAQuery q = em.createQuery("select o from named o");
q.compile();
em.close();
// make sure that there's an entry in the cache now
assertEquals(1, cache.size());