tx.success();
}
try (final Tx tx = app.tx()) {
Result result = app.nodeQuery(type).getResult();
assertEquals(number, result.size());
PropertyKey sortKey = TestOne.aDate;
boolean sortDesc = false;
int pageSize = 10;
int page = 1;
result = app.nodeQuery(type).sort(sortKey).order(sortDesc).page(page).pageSize(pageSize).getResult();
// for (GraphObject obj : result.getResults()) {
//
// System.out.println(obj.getProperty(AbstractNode.name) + ", " + obj.getProperty(TestOne.Key.aDate.name()));
// }
logger.log(Level.INFO, "Raw result size: {0}, expected: {1}", new Object[] { result.getRawResultCount(), number });
assertTrue(result.getRawResultCount() == number);
logger.log(Level.INFO, "Result size: {0}, expected: {1}", new Object[] { result.size(), pageSize });
assertTrue(result.size() == Math.min(number, pageSize));
for (int j = 0; j < Math.min(result.size(), pageSize); j++) {
String expectedName = "TestOne-" + (offset + j);
String gotName = result.get(j).getProperty(AbstractNode.name);
System.out.println(expectedName + ", got: " + gotName);
assertEquals(expectedName, gotName);
}