@Test
public void testHadoopFsListAsArray() {

  try {
    String tmpFileName1 = "/tmp/testHadoopFsListAsArray1";
    String tmpFileName2 = "/tmp/testHadoopFsListAsArray2";
    File tmpFile1 = new File(tmpFileName1);
    File tmpFile2 = new File(tmpFileName2);
    tmpFile1.createNewFile();
    tmpFile2.createNewFile();
    Assert.assertTrue(TempletonUtils.hadoopFsListAsArray(null, null, null) == null);
    Assert.assertTrue(TempletonUtils.hadoopFsListAsArray(tmpFileName1 + "," + tmpFileName2,
      null, null) == null);
    String[] tmp2
      = TempletonUtils.hadoopFsListAsArray(tmpFileName1 + "," + tmpFileName2,
                                           new Configuration(), null);
    Assert.assertEquals("file:" + tmpFileName1, tmp2[0]);
    Assert.assertEquals("file:" + tmpFileName2, tmp2[1]);
    tmpFile1.delete();
    tmpFile2.delete();
  } catch (FileNotFoundException e) {
    Assert.fail("Couldn't find name for " + tmpFile.toURI().toString());
  } catch (Exception e) {
    // Something else is wrong
    e.printStackTrace();
  }
  try {
    TempletonUtils.hadoopFsListAsArray("/scoobydoo/teddybear,joe",
                       new Configuration(),
                       null);
    Assert.fail("Should not have found /scoobydoo/teddybear");
  } catch (FileNotFoundException e) {
    // Should go here.
  } catch (Exception e) {
    // Something else is wrong.
    e.printStackTrace();
  }
}