verifyWindowOrder(expectedIds, out, new SchemaPath("ref.segment", ExpressionPosition.UNKNOWN), new SchemaPath("ref.position", ExpressionPosition.UNKNOWN));
}
private void verifyWindowOrder(List<WindowObj> expectedIds, RecordIterator out, SchemaPath segment, SchemaPath position) {
RecordIterator.NextOutcome outcome = out.next();
RecordPointer pointer = out.getRecordPointer();
int count = 0;
SchemaPath id = new SchemaPath("test.id", ExpressionPosition.UNKNOWN);
int expectedSize = expectedIds.size();
while (outcome != RecordIterator.NextOutcome.NONE_LEFT) {
count += 1;
WindowObj windowObj = expectedIds.get(count - 1);
//System.out.println(windowObj);
assertEquals("Id mismatch", windowObj.id, pointer.getField(id).getAsNumeric().getAsInt());
assertEquals("Window id mismatch", windowObj.windowId, pointer.getField(segment).getAsNumeric().getAsInt());
assertEquals("Position mismatch", windowObj.position, pointer.getField(position).getAsNumeric().getAsInt());
outcome = out.next();
}
assertEquals(expectedSize, count);
}