};
public void testCacheMarshallerEndToEnd()
throws IOException {
OpenJPAEntityManagerFactorySPI emf = createEMF(STORE_PROPS);
CacheMarshallerImpl cm = (CacheMarshallerImpl)
CacheMarshallersValue.getMarshallerById(
emf.getConfiguration(), MetaDataCacheMaintenance.class.getName());
cm.getOutputFile().delete();
MetaDataCacheMaintenance maint = new MetaDataCacheMaintenance(
JPAFacadeHelper.toBrokerFactory(emf), false);
LogImpl log = new LogImpl();
maint.setLog(log);
maint.store();
assertContains(log.lines, " " + AllFieldTypes.class.getName());
assertContains(log.lines, " " + NamedQueryEntity.class.getName());
assertContains(log.lines, " NamedQueryEntity.namedQuery");
clear(emf);
closeEMF(emf);
emf = createEMF(LOAD_PROPS);
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
em.persist(new NamedQueryEntity("foo"));
em.flush();
Query q = em.createNamedQuery("NamedQueryEntity.namedQuery");
assertEquals(1, q.getResultList().size());