/** * Test regular file open. * * @throws Exception If failed. */ @Test public void testOpen() throws Exception { create(igfs, paths(DIR, SUBDIR), null); createFile(igfs, FILE, true, chunk); checkFileContent(igfs, FILE, chunk); // Read again when the whole file is in memory. checkFileContent(igfs, FILE, chunk); }
checkFileContent(igfs, FILE, data);
checkFileContent(igfs, FILE, chunk);
checkFileContent(igfs0, path, data); checkExist(nodeDatas[n].igfsImpl, path); checkFileContent(nodeDatas[n].igfsImpl, path, data); checkFileContent(igfs0, path, data);
/** * Checks simple write. * * @throws Exception On error. */ @Test public void testSimpleWrite() throws Exception { IgfsPath path = new IgfsPath("/file1"); IgfsOutputStream os = igfs.create(path, 128, true/*overwrite*/, null, 0, 256, null); os.write(chunk); os.close(); assert igfs.exists(path); checkFileContent(igfs, path, chunk); os = igfs.create(path, 128, true/*overwrite*/, null, 0, 256, null); assert igfs.exists(path); os.write(chunk); assert igfs.exists(path); os.write(chunk); assert igfs.exists(path); os.close(); assert igfs.exists(path); checkFileContent(igfs, path, chunk, chunk); }
checkFileContent(igfs0, path, data, data);