@Test
public void testFTPDataConnectionMode() throws Exception {

  Configuration conf = new Configuration();
  FTPClient client = new FTPClient();
  FTPFileSystem ftp = new FTPFileSystem();
  assertEquals(FTPClient.ACTIVE_LOCAL_DATA_CONNECTION_MODE,
      client.getDataConnectionMode());
  ftp.setDataConnectionMode(client, conf);
  assertEquals(FTPClient.ACTIVE_LOCAL_DATA_CONNECTION_MODE,
      client.getDataConnectionMode());
  conf.set(FTPFileSystem.FS_FTP_DATA_CONNECTION_MODE, "invalid");
  ftp.setDataConnectionMode(client, conf);
  assertEquals(FTPClient.ACTIVE_LOCAL_DATA_CONNECTION_MODE,
      client.getDataConnectionMode());
  conf.set(FTPFileSystem.FS_FTP_DATA_CONNECTION_MODE,
      "PASSIVE_LOCAL_DATA_CONNECTION_MODE");
  ftp.setDataConnectionMode(client, conf);
  assertEquals(FTPClient.PASSIVE_LOCAL_DATA_CONNECTION_MODE,
      client.getDataConnectionMode());
}