private void testMap(int num, String name, Class keyClass, Class valueClass)
throws Exception {
OpenJPAEntityManager srcpm = getPM(true, true);
startTx(srcpm);
PersistentMapHolder holder = getHolder(srcpm);
Map map = holder.getNamedMap(name);
Map internalMap = new HashMap();
for (int i = 0; i < num; i++) {
Object key = keyInstance(keyClass);
Object value = keyInstance(valueClass);
map.put(key, value);
internalMap.put(key, value);
assertEquals(map.get(key), internalMap.get(key));
}
endTx(srcpm);
OpenJPAEntityManager pm = getPM();
startTx(pm);
// holder = getHolder(pm);
map = holder.getNamedMap(name);
for (Iterator i = internalMap.keySet().iterator(); i.hasNext();) {
Object k = i.next();
assertEquals(map.get(k), internalMap.get(k));
}
endTx(pm);