ArrayList<Activity> forwardActivities = new ArrayList<Activity>();
CursorToMany<Activity> cursor = theAccount.getActivitiesCursor();
int counter = 0;
while(cursor.next()) {
Activity current = cursor.getCurrent();
forwardActivities.add(current);
if(counter == 0)
Assert.assertEquals("dean", current.getName());
counter++;
}
Assert.assertEquals(3, counter);
ArrayList<Activity> reverseActivities = new ArrayList<Activity>();
cursor = theAccount.getActivitiesCursor();
cursor.afterLast();
counter = 0;
while(cursor.previous()) {
Activity current = cursor.getCurrent();
reverseActivities.add(0, current);
if(counter == 2)
Assert.assertEquals("dean", current.getName());
counter++;
}
Assert.assertEquals(3, counter);
for (int i=0; i<forwardActivities.size(); i++) {