@Test
public void testResolve() throws IOException {

  File mapFile = File.createTempFile(getClass().getSimpleName() +
      ".testResolve", ".txt");
  Files.write("a.b.c /rack1\n" +
              "1.2.3.4\t/rack2\n", mapFile, Charsets.UTF_8);
  mapFile.deleteOnExit();
  TableMapping mapping = new TableMapping();
  Configuration conf = new Configuration();
  conf.set(NET_TOPOLOGY_TABLE_MAPPING_FILE_KEY, mapFile.getCanonicalPath());
  mapping.setConf(conf);
  List<String> names = new ArrayList<String>();
  names.add("a.b.c");
  names.add("1.2.3.4");
  List<String> result = mapping.resolve(names);
  assertEquals(names.size(), result.size());
  assertEquals("/rack1", result.get(0));
  assertEquals("/rack2", result.get(1));
}