@Test
  public void testGetAllTables() throws Exception {
    List<String> tables = client.getAllTables(DEFAULT_DATABASE);
    Assert.assertEquals("All tables size", 5, tables.size());
    for(Table table : testTables) {
      if (table.getDbName().equals(DEFAULT_DATABASE)) {
        Assert.assertTrue("Checking table names", tables.contains(table.getTableName()));
      }
    }

    // Drop one table, see what remains
    client.dropTable(testTables[1].getCatName(), testTables[1].getDbName(), testTables[1] .getTableName());
    tables = client.getAllTables(DEFAULT_DATABASE);
    Assert.assertEquals("All tables size", 4, tables.size());
    for(Table table : testTables) {
      if (table.getDbName().equals(DEFAULT_DATABASE)
              && !table.getTableName().equals(testTables[1].getTableName())) {
        Assert.assertTrue("Checking table names", tables.contains(table.getTableName()));
      }
    }

    // No such database
    tables = client.getAllTables("no_such_database");
    Assert.assertEquals("All tables size", 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