INodeFile extends INode { public long getPreferredBlockSize() { return header & ~HEADERMASK; } INodeFile(PermissionStatus permissions, int nrBlocks, short replication, long modificationTime, long atime,
      long preferredBlockSize); protected  INodeFile(); protected  INodeFile(PermissionStatus permissions, BlockInfo[] blklist, short replication, long modificationTime,
      long atime, long preferredBlockSize); boolean isDirectory(); short getReplication(); void setReplication(short replication); long getPreferredBlockSize(); void setPreferredBlockSize(long preferredBlkSize);  }
@Test public void testPreferredBlockSize () { replication = 3; preferredBlockSize = 128*1024*1024; INodeFile inf = new INodeFile(new PermissionStatus(userName, null, FsPermission.getDefault()), null, replication, 0L, 0L, preferredBlockSize); assertEquals("True has to be returned in this case", preferredBlockSize, inf.getPreferredBlockSize()); }
@Test public void testPreferredBlockSizeUpperBound () { replication = 3; preferredBlockSize = BLKSIZE_MAXVALUE; INodeFile inf = new INodeFile(new PermissionStatus(userName, null, FsPermission.getDefault()), null, replication, 0L, 0L, preferredBlockSize); assertEquals("True has to be returned in this case", BLKSIZE_MAXVALUE, inf.getPreferredBlockSize()); }