@Test(timeout=60000)
public void testBadFile() throws IOException {

  File mapFile = File.createTempFile(getClass().getSimpleName() +
      ".testBadFile", ".txt");
  Files.write("bad contents", 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(result.get(0), NetworkTopology.DEFAULT_RACK);
  assertEquals(result.get(1), NetworkTopology.DEFAULT_RACK);
}