}
}
// check paging
int pageSize = 5;
CmisObject lastObject = null;
int count = 0;
ItemIterable<CmisObject> page1 = testFolder.getChildren(SELECT_ALL_NO_CACHE_OC_ORDER_BY_NAME).getPage(
pageSize);
for (CmisObject child : page1) {
count++;
lastObject = child;
}
f = createResult(FAILURE, "Returned number of children doesn't match the page size!");
addResult(assertEquals(pageSize, count, null, f));
count = 0;
ItemIterable<CmisObject> page2 = testFolder.getChildren(SELECT_ALL_NO_CACHE_OC_ORDER_BY_NAME)
.skipTo(pageSize - 1).getPage(pageSize);
for (CmisObject child : page2) {
count++;
if (count == 1) {
f = createResult(FAILURE,
"Last object of the first page doesn't match the first object of the second page.");
addResult(assertEquals(lastObject.getId(), child.getId(), null, f));
}
}
f = createResult(FAILURE, "Returned number of children doesn't match the page size!");
addResult(assertEquals(pageSize, count, null, f));