/** * Test create when parent is the root. * * @throws Exception If failed. */ @Test public void testCreateParentRoot() throws Exception { IgfsPath file = new IgfsPath("/" + FILE.name()); createFile(igfs, file, true, chunk); checkFile(igfs, igfsSecondary, file, chunk); }
/** * Test directory move when source parent is the root. * * @throws Exception If failed. */ @Test public void testMoveDirectorySourceParentRoot() throws Exception { IgfsPath dir = new IgfsPath("/" + SUBSUBDIR.name()); create(igfs, paths(DIR_NEW, SUBDIR_NEW, dir), null); igfs.rename(dir, SUBDIR_NEW); checkExist(igfs, igfsSecondary, new IgfsPath(SUBDIR_NEW, SUBSUBDIR.name())); checkNotExist(igfs, igfsSecondary, dir); }
/** * Test file move when source parent is the root. * * @throws Exception If failed. */ @Test public void testMoveFileSourceParentRoot() throws Exception { IgfsPath file = new IgfsPath("/" + FILE.name()); create(igfs, paths(DIR_NEW, SUBDIR_NEW), paths(file)); igfs.rename(file, SUBDIR_NEW); checkExist(igfs, igfsSecondary, new IgfsPath(SUBDIR_NEW, FILE.name())); checkNotExist(igfs, igfsSecondary, file); }
/** * Test file move when source parent is the root and the source is missing. * * @throws Exception If failed. */ @Test public void testMoveFileSourceParentRootSourceMissing() throws Exception { IgfsPath file = new IgfsPath("/" + FILE.name()); create(igfsSecondary, paths(DIR_NEW, SUBDIR_NEW), paths(file)); create(igfs, paths(DIR_NEW, SUBDIR_NEW), null); igfs.rename(file, SUBDIR_NEW); checkExist(igfs, igfsSecondary, new IgfsPath(SUBDIR_NEW, FILE.name())); checkNotExist(igfs, igfsSecondary, file); }
/** * Test directory move when destination is the root. * * @throws Exception If failed. */ @Test public void testMoveDirectoryDestinationRoot() throws Exception { create(igfs, paths(DIR, SUBDIR, SUBSUBDIR), null); igfs.rename(SUBSUBDIR, IgfsPath.ROOT); checkExist(igfs, igfsSecondary, new IgfsPath("/" + SUBSUBDIR.name())); checkNotExist(igfs, igfsSecondary, SUBSUBDIR); }
/** * Test directory move and rename when source parent is the root. * * @throws Exception If failed. */ @Test public void testMoveRenameDirectorySourceParentRoot() throws Exception { IgfsPath dir = new IgfsPath("/" + SUBSUBDIR_NEW.name()); create(igfs, paths(DIR_NEW, SUBDIR_NEW, dir), null); igfs.rename(dir, SUBSUBDIR_NEW); checkExist(igfs, igfsSecondary, SUBSUBDIR_NEW); checkNotExist(igfs, igfsSecondary, dir); }
/** * Test move in case both local and remote file systems have the same folder structure and the path being renamed is * a directory. * * @throws Exception If failed. */ @Test public void testMoveDirectory() throws Exception { create(igfs, paths(DIR, SUBDIR, SUBSUBDIR, DIR_NEW, SUBDIR_NEW), null); igfs.rename(SUBSUBDIR, SUBDIR_NEW); checkExist(igfs, igfsSecondary, new IgfsPath(SUBDIR_NEW, SUBSUBDIR.name())); checkNotExist(igfs, igfsSecondary, SUBSUBDIR); }
/** * Test directory move and rename when destination is the root. * * @throws Exception If failed. */ @Test public void testMoveRenameDirectoryDestinationRoot() throws Exception { IgfsPath dir = new IgfsPath("/" + SUBSUBDIR.name()); create(igfs, paths(DIR, SUBDIR, SUBSUBDIR), null); igfs.rename(SUBSUBDIR, dir); checkExist(igfs, igfsSecondary, dir); checkNotExist(igfs, igfsSecondary, SUBSUBDIR); }
/** * Test file move when destination is the root. * * @throws Exception If failed. */ @Test public void testMoveFileDestinationRoot() throws Exception { create(igfs, paths(DIR, SUBDIR), paths(FILE)); igfs.rename(FILE, IgfsPath.ROOT); checkExist(igfs, igfsSecondary, new IgfsPath("/" + FILE.name())); checkNotExist(igfs, igfsSecondary, FILE); }
/** * Test file move and rename when source parent is the root. * * @throws Exception If failed. */ @Test public void testMoveRenameFileSourceParentRoot() throws Exception { IgfsPath file = new IgfsPath("/" + FILE_NEW.name()); create(igfs, paths(DIR_NEW, SUBDIR_NEW), paths(file)); igfs.rename(file, FILE_NEW); checkExist(igfs, igfsSecondary, FILE_NEW); checkNotExist(igfs, igfsSecondary, file); }
/** * Test file move and rename when destination is the root. * * @throws Exception If failed. */ @Test public void testMoveRenameFileDestinationRoot() throws Exception { IgfsPath file = new IgfsPath("/" + FILE.name()); create(igfs, paths(DIR, SUBDIR), paths(FILE)); igfs.rename(FILE, file); checkExist(igfs, igfsSecondary, file); checkNotExist(igfs, igfsSecondary, FILE); }
/** * Test move in case both local and remote file systems have the same folder structure and the path being renamed is * a file. * * @throws Exception If failed. */ @Test public void testMoveFile() throws Exception { create(igfs, paths(DIR, SUBDIR, DIR_NEW, SUBDIR_NEW), paths(FILE)); igfs.rename(FILE, SUBDIR_NEW); checkExist(igfs, igfsSecondary, new IgfsPath(SUBDIR_NEW, FILE.name())); checkNotExist(igfs, igfsSecondary, FILE); }
/** * Test move in case source and destination don't exist and the path being renamed is a directory. * * @throws Exception If failed. */ @Test public void testMoveDirectorySourceAndDestinationMissing() throws Exception { create(igfsSecondary, paths(DIR, SUBDIR, SUBSUBDIR, DIR_NEW, SUBDIR_NEW), null); create(igfs, null, null); igfs.rename(SUBSUBDIR, SUBDIR_NEW); checkExist(igfs, DIR, SUBDIR, DIR_NEW, SUBDIR_NEW); checkExist(igfs, igfsSecondary, new IgfsPath(SUBDIR_NEW, SUBSUBDIR.name())); checkNotExist(igfs, igfsSecondary, SUBSUBDIR); }
/** * Test move in case source and destination don't exist and the path being renamed is a file. * * @throws Exception If failed. */ @Test public void testMoveFileSourceAndDestinationMissing() throws Exception { create(igfsSecondary, paths(DIR, SUBDIR, DIR_NEW, SUBDIR_NEW), paths(FILE)); create(igfs, null, null); igfs.rename(FILE, SUBDIR_NEW); checkExist(igfs, DIR, SUBDIR, DIR_NEW, SUBDIR_NEW); checkExist(igfs, igfsSecondary, new IgfsPath(SUBDIR_NEW, FILE.name())); checkNotExist(igfs, igfsSecondary, FILE); }
/** * Test move in case source exists partially and the path being renamed is a directory. * * @throws Exception If failed. */ @Test public void testMoveDirectorySourceMissingPartially() throws Exception { create(igfsSecondary, paths(DIR, SUBDIR, SUBSUBDIR, DIR_NEW, SUBDIR_NEW), null); create(igfs, paths(DIR, DIR_NEW, SUBDIR_NEW), null); igfs.rename(SUBSUBDIR, SUBDIR_NEW); checkExist(igfs, SUBDIR); checkExist(igfs, igfsSecondary, new IgfsPath(SUBDIR_NEW, SUBSUBDIR.name())); checkNotExist(igfs, igfsSecondary, SUBSUBDIR); }
/** * Test move in case destination exists partially and the path being renamed is a directory. * * @throws Exception If failed. */ @Test public void testMoveDirectoryDestinationMissingPartially() throws Exception { create(igfsSecondary, paths(DIR, SUBDIR, SUBSUBDIR, DIR_NEW, SUBDIR_NEW), null); create(igfs, paths(DIR, SUBDIR, SUBSUBDIR, DIR_NEW), null); igfs.rename(SUBSUBDIR, SUBDIR_NEW); checkExist(igfs, SUBDIR_NEW); checkExist(igfs, igfsSecondary, new IgfsPath(SUBDIR_NEW, SUBSUBDIR.name())); checkNotExist(igfs, igfsSecondary, SUBSUBDIR); }
/** * Test move in case source and destination exist partially and the path being renamed is a directory. * * @throws Exception If failed. */ @Test public void testMoveDirectorySourceAndDestinationMissingPartially() throws Exception { create(igfsSecondary, paths(DIR, SUBDIR, SUBSUBDIR, DIR_NEW, SUBDIR_NEW), null); create(igfs, paths(DIR, DIR_NEW), null); igfs.rename(SUBSUBDIR, SUBDIR_NEW); checkExist(igfs, SUBDIR, SUBDIR_NEW); checkExist(igfs, igfsSecondary, new IgfsPath(SUBDIR_NEW, SUBSUBDIR.name())); checkNotExist(igfs, igfsSecondary, SUBSUBDIR); }
/** * Test directory move when destination is the root and source is missing partially. * * @throws Exception If failed. */ @Test public void testMoveDirectoryDestinationRootSourceMissingPartially() throws Exception { create(igfsSecondary, paths(DIR, SUBDIR, SUBSUBDIR), null); create(igfs, paths(DIR), null); igfs.rename(SUBSUBDIR, IgfsPath.ROOT); checkExist(igfs, SUBDIR); checkExist(igfs, igfsSecondary, new IgfsPath("/" + SUBSUBDIR.name())); checkNotExist(igfs, igfsSecondary, SUBSUBDIR); }
/** * Test move in case source and destination exist partially and the path being renamed is a file. * * @throws Exception If failed. */ @Test public void testMoveFileSourceAndDestinationMissingPartially() throws Exception { create(igfsSecondary, paths(DIR, SUBDIR, DIR_NEW, SUBDIR_NEW), paths(FILE)); create(igfs, paths(DIR, DIR_NEW), null); igfs.rename(FILE, SUBDIR_NEW); checkExist(igfs, SUBDIR, SUBDIR_NEW); checkExist(igfs, igfsSecondary, new IgfsPath(SUBDIR_NEW, FILE.name())); checkNotExist(igfs, igfsSecondary, FILE); }
/** * Test move in case source doesn't exist and the path being renamed is a file. * * @throws Exception If failed. */ @Test public void testMoveFileSourceMissing() throws Exception { create(igfsSecondary, paths(DIR, SUBDIR, DIR_NEW, SUBDIR_NEW), paths(FILE)); create(igfs, paths(DIR_NEW, SUBDIR_NEW), paths(FILE)); igfs.rename(FILE, SUBDIR_NEW); checkExist(igfs, DIR, SUBDIR); checkExist(igfs, igfsSecondary, new IgfsPath(SUBDIR_NEW, FILE.name())); checkNotExist(igfs, igfsSecondary, FILE); }