}
assertTrue("Make sure directory is created.",
dfs.exists(new Path(checkpointedDir)));
byte[] tmpData = "data".getBytes();
BSPMessageBundle bundle = new BSPMessageBundle();
bundle.addMessage(new ByteMessage("abc".getBytes(), tmpData));
assertNotNull("Message bundle can not be null.", bundle);
assertNotNull("Configuration should not be null.", config);
bspTask.checkpoint(checkpointedDir + "/attempt_201110302255_0001_000000_0",
bundle);
FSDataInputStream in = dfs.open(new Path(checkpointedDir
+ "/attempt_201110302255_0001_000000_0"));
BSPMessageBundle bundleRead = new BSPMessageBundle();
bundleRead.readFields(in);
in.close();
ByteMessage byteMsg = (ByteMessage) (bundleRead.getMessages()).get(0);
String content = new String(byteMsg.getData());
LOG.info("Saved checkpointed content is " + content);
assertTrue("Message content should be the same.", "data".equals(content));
dfs.delete(new Path("checkpoint"), true);
}