List<Activity> all = Activity.findAll(mgr, 2);
Assert.assertEquals(5, all.size());
//should retrieve from the cache...
Activity act = mgr.find(Activity.class, all.get(0).getId());
act.getId();
List<Activity> all2 = Activity.findAll2(mgr, 3);
Assert.assertEquals(3, all2.size());
List<Activity> list = Activity.findBetween(mgr, 4, 7);
Assert.assertEquals(2, list.size());
if(list.get(0).getNumTimes() != 4) {
Activity item1 = list.get(0);
Activity item2 = list.get(1);
log.info("shutdown now. failure item1="+item1.getNumTimes()+"/"+item1.getName()+" item2="+item2.getNumTimes()+"/"+item2.getName());
Thread.sleep(600000);
}
Assert.assertEquals(4, list.get(0).getNumTimes());
Assert.assertEquals(5, list.get(1).getNumTimes());
List<Activity> list2 = Activity.findBetween2(mgr, 4, 7);
Assert.assertEquals(2, list2.size());
if(list2.get(0).getNumTimes() != 5) {
Activity item1 = list2.get(0);
Activity item2 = list2.get(1);
log.info("shutdown now. failure item1="+item1.getNumTimes()+"/"+item1.getName()+" item2="+item2.getNumTimes()+"/"+item2.getName());
Thread.sleep(600000);
}
Assert.assertEquals(5, list2.get(0).getNumTimes());
Assert.assertEquals(7, list2.get(1).getNumTimes());