public static void assertExternalFileList(List<String> expected, String dumplocation,
                                            WarehouseInstance warehouseInstance) throws IOException {
    Path hivePath = new Path(dumplocation, ReplUtils.REPL_HIVE_BASE_DIR);
    Path externalTableFileList = new Path(hivePath, EximUtil.FILE_LIST_EXTERNAL);
    DistributedFileSystem fileSystem = warehouseInstance.miniDFSCluster.getFileSystem();
    Assert.assertTrue(fileSystem.exists(externalTableFileList));
    InputStream inputStream = fileSystem.open(externalTableFileList);
    BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
    Set<String> tableNames = new HashSet<>();
    for (String line = reader.readLine(); line != null; line = reader.readLine()) {
      String[] components = line.split(DirCopyWork.URI_SEPARATOR);
      Assert.assertEquals("The file should have sourcelocation#targetlocation#tblName#copymode", 5,
          components.length);
      tableNames.add(components[2]);
      Assert.assertTrue(components[0].length() > 0);
      Assert.assertTrue(components[1].length() > 0);
      Assert.assertTrue(components[2].length() > 0);
      Assert.assertTrue(components[3].length() > 0);
    }
    Assert.assertTrue(tableNames.containsAll(expected));
    reader.close();
  }
ReplicationTestUtils - static helper functions for replication test
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/ReplicationTestUtils.java