@Test
public void testChecking2NameDirsOnOneVolume() throws IOException {

  Configuration conf = new Configuration();
  File nameDir1 = new File(System.getProperty("test.build.data"), "name-dir1");
  File nameDir2 = new File(System.getProperty("test.build.data"), "name-dir2");
  nameDir1.mkdirs();
  nameDir2.mkdirs();
  conf.set("dfs.name.dir",
      nameDir1.getAbsolutePath() + "," + nameDir2.getAbsolutePath());
  conf.setLong(DFSConfigKeys.DFS_NAMENODE_DU_RESERVED_KEY, Long.MAX_VALUE);
  NameNodeResourceChecker nb = new NameNodeResourceChecker(conf);
  assertEquals("Should not check the same volume more than once.",
      1, nb.getVolumesLowOnSpace().size());
}