// this is to prevent caching at the entity manager level
em.clear();
}
private void testRange(int first, int max, int expected) {
TaskFetcher taskFetcher = new TaskFetcher(factory.createEntityManager());
HashMap map = new HashMap();
map.put(TaskFetcher.FETCH_USER, new UserRoles("user1",
new String[] { "examples\\employee" }));
map.put(TaskFetcher.FETCH_CLASS, PATask.class);
map.put(TaskFetcher.FETCH_SUB_QUERY, "");
map.put(TaskFetcher.FETCH_FIRST, first);
map.put(TaskFetcher.FETCH_MAX, max);
this._logger.debug("Testing range with :first=" + first + " and :max="
+ max + " ; expected:" + expected);
Assert.assertEquals(expected,
taskFetcher.fetchAvailableTasks(map).length);
}