for (int i = 0; i < expectedResults.length; i++) {
numExecutedCommands += expectedResults[i];
}
FakePDM fakePDM = new FakePDM(numExecutedCommands);
BatchedUpdateNode node = helpOpen(commands, fakePDM);
TupleBatch batch = null;
try {
batch = node.nextBatch();
} catch (BlockedException e) {
batch = node.nextBatch();
}
assertNotNull(batch);
assertTrue(batch.getTerminationFlag());
assertEquals(expectedResults.length, batch.getRowCount());
for (int i = 0; i < expectedResults.length; i++) {
List tuple = batch.getTuple(i+1);
assertNotNull(tuple);
Object result = tuple.get(0);
assertNotNull(result);
assertEquals(new Integer(expectedResults[i]), result);
}