LocatedBlocks[] blocksArr = ssProtocol.getLocatedBlocks("test", "/bar/foo");
assertTrue(blocksArr.length == 1); // 1 file
DFSClient client = new DFSClient(conf);
DFSInputStream stm = client.open("/bar/foo");
LocatedBlocks locBlks = blocksArr[0];
DFSLocatedBlocks dfsLocBlks = stm.fetchLocatedBlocks();
stm.close();
assertTrue(locBlks.locatedBlockCount() == 1); // one byte so must be one block
assertTrue(locBlks.locatedBlockCount() == dfsLocBlks.locatedBlockCount());
assertTrue(locBlks.get(0).getBlock().getBlockId() ==
dfsLocBlks.get(0).getBlock().getBlockId());
assertTrue(locBlks.getFileLength() == 1);
blocksArr = ssProtocol.getLocatedBlocks("test", "/bar/woot");
assertTrue(blocksArr.length == 1); // 1 file
stm = client.open("/bar/woot");
locBlks = blocksArr[0];
dfsLocBlks = stm.fetchLocatedBlocks();
stm.close();
assertTrue(locBlks.locatedBlockCount() == 1); // one byte so must be one block
assertTrue(locBlks.locatedBlockCount() == dfsLocBlks.locatedBlockCount());
assertTrue(locBlks.get(0).getBlock().getBlockId() ==
dfsLocBlks.get(0).getBlock().getBlockId());