@@ -0,0 +1,2028 @@
+package tachyon.client;%0A%0Aimport java.io.IOException;%0Aimport java.nio.ByteBuffer;%0A%0Aimport org.junit.After;%0Aimport org.junit.Assert;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport tachyon.TestUtils;%0Aimport tachyon.master.LocalTachyonCluster;%0Aimport tachyon.util.CommonUtils;%0A%0Apublic class BlockHandlerLocalFSTest %7B%0A%0A  private LocalTachyonCluster mLocalTachyonCluster = null;%0A  private TachyonFS mTfs = null;%0A%0A  @After%0A  public final void after() throws Exception %7B%0A    mLocalTachyonCluster.stop();%0A    System.clearProperty(%22tachyon.user.quota.unit.bytes%22);%0A  %7D%0A%0A  @Before%0A  public final void before() throws IOException %7B%0A    System.setProperty(%22tachyon.user.quota.unit.bytes%22, %221000%22);%0A    mLocalTachyonCluster = new LocalTachyonCluster(10000);%0A    mLocalTachyonCluster.start();%0A    mTfs = mLocalTachyonCluster.getClient();%0A  %7D%0A%0A  @Test%0A  public void readTest() throws IOException %7B%0A    int fileId = TestUtils.createByteFile(mTfs, %22/root/testFile%22, WriteType.MUST_CACHE, 100);%0A    long blockId = mTfs.getBlockId(fileId, 0);%0A    String filename = mTfs.getLocalFilename(blockId);%0A    BlockHandler handler = BlockHandler.get(filename, null);%0A    ByteBuffer buf = handler.readByteBuffer(0, 100);%0A    Assert.assertEquals(TestUtils.getIncreasingByteBuffer(100), buf);%0A    buf = handler.readByteBuffer(0, -1);%0A    Assert.assertEquals(TestUtils.getIncreasingByteBuffer(100), buf);%0A    handler.close();%0A    return;%0A  %7D%0A%0A  @Test%0A  public void writeTest() throws IOException %7B%0A    int fileId = mTfs.createFile(%22/root/testFile%22);%0A    long blockId = mTfs.getBlockId(fileId, 0);%0A    String localFolder = mTfs.createAndGetUserTempFolder().getPath();%0A    String filename = CommonUtils.concat(localFolder, blockId);%0A    BlockHandler handler = BlockHandler.get(filename, null);%0A    byte%5B%5D buf = TestUtils.getIncreasingByteArray(100);%0A    handler.appendCurrentBuffer(buf, 0, 0, 100);%0A    handler.close();%0A    mTfs.cacheBlock(blockId);%0A    long fileLen = mTfs.getFileLength(fileId);%0A    Assert.assertEquals(100, fileLen);%0A    return;%0A  %7D%0A%7D%0A

add test case for BlockHandlerLocalFS