@Test
  public void testGetTableObjectsByName() throws Exception {
    List<String> tableNames = new ArrayList<>();
    tableNames.add(testTables[0].getTableName());
    tableNames.add(testTables[1].getTableName());
    List<Table> tables = client.getTableObjectsByName(DEFAULT_DATABASE, tableNames);
    Assert.assertEquals("Found tables", 2, tables.size());
    for(Table table : tables) {
      if (table.getTableName().equals(testTables[0].getTableName())) {
        Assert.assertEquals("Comparing tables", testTables[0], table);
      } else {
        Assert.assertEquals("Comparing tables", testTables[1], table);
      }
    }

    // Test with empty array
    tables = client.getTableObjectsByName(DEFAULT_DATABASE, new ArrayList<>());
    Assert.assertEquals("Found tables", 0, tables.size());

    // Test with table name which does not exists
    tableNames = new ArrayList<>();
    tableNames.add("no_such_table");
    client.getTableObjectsByName(testTables[0].getCatName(), testTables[0].getDbName(), tableNames);
    Assert.assertEquals("Found tables", 0, tables.size());

    // Test with table name which does not exists in the given database
    tableNames = new ArrayList<>();
    tableNames.add(testTables[0].getTableName());
    client.getTableObjectsByName(OTHER_DATABASE, tableNames);
    Assert.assertEquals("Found tables", 0, tables.size());

  }
Test class for IMetaStoreClient API. Testing the Table related functions for metadata
querying like getting one, or multiple tables, and table name lists.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestTablesGetExists.java