}
}
public void checkInvalidBlock(Block b) throws IOException {
FSDatasetInterface fsdataset = new SimulatedFSDataset(conf);
assertFalse(fsdataset.isValidBlock(0, b, false));
try {
fsdataset.getFinalizedBlockLength(0,b);
assertTrue("Expected an IO exception", false);
} catch (IOException e) {
// ok - as expected
}
try {
ReplicaToRead replica = fsdataset.getReplicaToRead(0, b);
if (replica != null) {
InputStream input = replica.getBlockInputStream(null, 0);
assertTrue("Expected an IO exception", false);
}
} catch (IOException e) {
// ok - as expected
}
try {
fsdataset.finalizeBlock(0,b);
assertTrue("Expected an IO exception", false);
} catch (IOException e) {
// ok - as expected
}