@Test
public void testFTPTransferMode() throws Exception {

  Configuration conf = new Configuration();
  FTPFileSystem ftp = new FTPFileSystem();
  assertEquals(FTP.BLOCK_TRANSFER_MODE, ftp.getTransferMode(conf));
  conf.set(FTPFileSystem.FS_FTP_TRANSFER_MODE, "STREAM_TRANSFER_MODE");
  assertEquals(FTP.STREAM_TRANSFER_MODE, ftp.getTransferMode(conf));
  conf.set(FTPFileSystem.FS_FTP_TRANSFER_MODE, "COMPRESSED_TRANSFER_MODE");
  assertEquals(FTP.COMPRESSED_TRANSFER_MODE, ftp.getTransferMode(conf));
  conf.set(FTPFileSystem.FS_FTP_TRANSFER_MODE, "invalid");
  assertEquals(FTPClient.BLOCK_TRANSFER_MODE, ftp.getTransferMode(conf));
}