/** * Ensure correct size calculation. * * @throws Exception If failed. */ @Test public void testSize() throws Exception { IgfsPath dir1 = path("/dir1"); IgfsPath subDir1 = path("/dir1/subdir1"); IgfsPath dir2 = path("/dir2"); IgfsPath fileDir1 = path("/dir1/file"); IgfsPath fileSubdir1 = path("/dir1/subdir1/file"); IgfsPath fileDir2 = path("/dir2/file"); IgfsOutputStream os = igfs.create(fileDir1, false); os.write(new byte[1000]); os.close(); os = igfs.create(fileSubdir1, false); os.write(new byte[2000]); os.close(); os = igfs.create(fileDir2, false); os.write(new byte[4000]); os.close(); assert igfs.size(fileDir1) == 1000; assert igfs.size(fileSubdir1) == 2000; assert igfs.size(fileDir2) == 4000; assert igfs.size(dir1) == 3000; assert igfs.size(subDir1) == 2000; assert igfs.size(dir2) == 4000; }