}
public void testReport() {
LOG.info("Test multi basic");
IncrementalBlockReport ibrSource = new IncrementalBlockReport(blocks);
long[] sourceBlocks = ibrSource.getBlockReportInLongs();
long[] sourceHintsMap = ibrSource.getHintsMap();
String[] sourceHints = ibrSource.getHints();
// check if the arrays are of correct length
assertEquals(NUM * BlockListAsLongs.LONGS_PER_BLOCK, sourceBlocks.length);
assertEquals(LightWeightBitSet.getBitArraySize(NUM), sourceHintsMap.length);
assertEquals(numReceived, LightWeightBitSet.cardinality(sourceHintsMap));
assertEquals(numReceived, sourceHints.length);
// check the contents
int i = 0;
String delHint = null;
Block blk = new Block();
while (ibrSource.hasNext()) {
delHint = ibrSource.getNext(blk);
// check if received/deleted
if (isBlockReceived[i]) {
ReceivedBlockInfo source = (ReceivedBlockInfo) blocks[i];
// check if delHints match
assertEquals(source.getDelHints(), delHint);
}
// check if id/size/genstamp match
// discard delHint (checked above)
assertEquals(new Block(blocks[i]), blk);
i++;
}
//check the length function
assertEquals(i, ibrSource.getLength());
// check if we've got all the blocks
assertEquals(NUM, i);
LOG.info("Test multi - DONE");