{
SimpleHome simpleHome = getSimpleHome();
Iterator simpleIter = simpleHome.findAll().iterator();
Simple simple = (Simple) simpleIter.next();
Object pk = simple.getPrimaryKey();
ReadAheadCache cache = jdbcStoreManager.getReadAheadCache();
ReadAheadCache.EntityReadAheadInfo info = cache.getEntityReadAheadInfo(pk);
assertEquals(pkList.subList(0, 4), info.getLoadKeys());
for (int i = 0; i < 4; i++)
{
Object o = pkList.get(i);
assertNull(cache.getPreloadDataMap(o, false));
}
simple.getStringValue(); // test0
assertNull(cache.getPreloadDataMap("test0", false));
for (int i = 1; i < 4; i++)
{
Object o = pkList.get(i);
assertNotNull(cache.getPreloadDataMap(o, false));
}
assertNull(cache.getPreloadDataMap("test4", false));
simple = (Simple) simpleIter.next(); // test1
simple.getStringValue();
assertNull(cache.getPreloadDataMap("test1", false));
simple = (Simple) simpleIter.next(); // test2
simple.getStringValue();
simple = (Simple) simpleIter.next(); // test3
simple.getStringValue();
for (int i = 0; i < 4; i++)
{
Object o = pkList.get(i);
assertNull(cache.getPreloadDataMap(o, false));
}
simple = (Simple) simpleIter.next(); // test4
simple.getStringValue();
for (int i = 5; i < 8; i++)
{
Object o = pkList.get(i);
assertNotNull(cache.getPreloadDataMap(o, false));
}
}