@Test
public void testDataStoreBlob() throws Exception {
FileDataStore fds = new FileDataStore();
fds.setMinRecordLength(4092);
fds.init(getWorkDir().getAbsolutePath());
DataStoreBlobStore dbs = new DataStoreBlobStore(fds);
nodeStore = getNodeStore(dbs);
//Test for Blob which get inlined
byte[] data = new byte[fds.getMinRecordLength()-2];
new Random().nextBytes(data);
Blob b1 = testCreateAndRead(nodeStore.createBlob(new ByteArrayInputStream(data)));
assertTrue(b1 instanceof SegmentBlob);
assertNull(((SegmentBlob) b1).getBlobId());
//Test for Blob which need to be pushed to BlobStore
byte[] data2 = new byte[Segment.MEDIUM_LIMIT + 1];
new Random().nextBytes(data2);
Blob b2 = testCreateAndRead(nodeStore.createBlob(new ByteArrayInputStream(data2)));
assertTrue(b2 instanceof SegmentBlob);
assertNotNull(b2.getReference());
InputStream is = dbs.getInputStream(((SegmentBlob) b2).getBlobId());
assertNotNull(IOUtils.contentEquals(new ByteArrayInputStream(data2), is));
is.close();
}