@Test public void testDoRename() throws Exception { FileObject fileObject = mock( FileObject.class ); FileName fileName = mock( FileName.class ); when( fileObject.getName() ).thenReturn( fileName ); String path2 = "fake-path-2"; when( fileName.getPath() ).thenReturn( path2 ); HadoopFileSystemPath newPath = mock( HadoopFileSystemPath.class ); when( hadoopFileSystem.getPath( path2 ) ).thenReturn( newPath ); hdfsFileObject.doRename( fileObject ); verify( hadoopFileSystem ).rename( hadoopFileSystemPath, newPath ); }
@Override protected void doRename( FileObject newfile ) throws Exception { hdfs.rename( hdfs.getPath( getName().getPath() ), hdfs.getPath( newfile.getName().getPath() ) ); }
HDFSFileObject extends AbstractFileObject { @Override protected void doRename( FileObject newfile ) throws Exception { hdfs.rename( hdfs.getPath( getName().getPath() ), hdfs.getPath( newfile.getName().getPath() ) ); } }
HDFSFileObject extends AbstractFileObject { @Override protected void doRename( FileObject newfile ) throws Exception { hdfs.rename( hdfs.getPath( getName().getPath() ), hdfs.getPath( newfile.getName().getPath() ) ); } HDFSFileObject( final AbstractFileName name, final HDFSFileSystem fileSystem ); }
HDFSFileObject extends AbstractFileObject { @Override protected void doRename( FileObject newfile ) throws Exception { hdfs.rename( hdfs.getPath( getName().getPath() ), hdfs.getPath( newfile.getName().getPath() ) ); } HDFSFileObject( final AbstractFileName name, final HDFSFileSystem fileSystem ); @Override void doCreateFolder(); @Override void doDelete(); }
HDFSFileObject extends AbstractFileObject { @Override protected void doRename( FileObject newfile ) throws Exception { hdfs.rename( hdfs.getPath( getName().getPath() ), hdfs.getPath( newfile.getName().getPath() ) ); } HDFSFileObject( final AbstractFileName name, final HDFSFileSystem fileSystem ); @Override void doCreateFolder(); @Override void doDelete();  }