public void testBasicQuery() {
basicQueries(factory.createEntityManager(), Boolean.FALSE, 3, 1);
basicQueries(factory.createEntityManager(), Boolean.TRUE, 3, 1);
// manually notify the cache of changes
QueryCache cache = cacheManager(factory).getSystemQueryCache();
// test to see if modifying B causes A's query cache to be flushed
Set s = new HashSet();
s.add(CacheObjectB.class);
cache.onTypesChanged(new TypesChangedEvent(this, s));
basicQueries(factory.createEntityManager(), Boolean.TRUE, 3, 1);
// test to see if modifying A causes A's query cache to be flushed
s.add(CacheObjectA.class);
cache.onTypesChanged(new TypesChangedEvent(this, s));
basicQueries(factory.createEntityManager(), Boolean.FALSE, 3, 1);
// make sure that non-manual notification works
EntityManager em = factory.createEntityManager();
try {