@Before
  public void setUp() throws Exception {
    // Get new client
    client = metaStore.getClient();

    // Clean up the database
    client.dropDatabase(OTHER_DATABASE, true, true, true);
    // Drop every table in the default database
    for(String tableName : client.getAllTables(DEFAULT_DATABASE)) {
      client.dropTable(DEFAULT_DATABASE, tableName, true, true, true);
    }

    // Clean up trash
    metaStore.cleanWarehouseDirs();

    testTables[0] =
        new TableBuilder()
            .setDbName(DEFAULT_DATABASE)
            .setTableName("filter_test_table_0")
            .addCol("test_col", "int")
            .setOwner("Owner1")
            .setLastAccessTime(1000)
            .addTableParam("param1", "value1")
            .create(client, metaStore.getConf());

    testTables[1] =
        new TableBuilder()
            .setDbName(DEFAULT_DATABASE)
            .setTableName("filter_test_table_1")
            .addCol("test_col", "int")
            .setOwner("Owner1")
            .setLastAccessTime(2000)
            .addTableParam("param1", "value2")
            .create(client, metaStore.getConf());

    testTables[2] =
        new TableBuilder()
            .setDbName(DEFAULT_DATABASE)
            .setTableName("filter_test_table_2")
            .addCol("test_col", "int")
            .setOwner("Owner2")
            .setLastAccessTime(1000)
            .addTableParam("param1", "value2")
            .create(client, metaStore.getConf());

    testTables[3] =
        new TableBuilder()
            .setDbName(DEFAULT_DATABASE)
            .setTableName("filter_test_table_3")
            .addCol("test_col", "int")
            .setOwner("Owner3")
            .setLastAccessTime(3000)
            .addTableParam("param1", "value2")
            .create(client, metaStore.getConf());

    testTables[4] =
        new TableBuilder()
            .setDbName(DEFAULT_DATABASE)
            .setTableName("filter_test_table_4")
            .addCol("test_col", "int")
            .setOwner("Tester")
            .setLastAccessTime(2500)
            .addTableParam("param1", "value4")
            .create(client, metaStore.getConf());

    testTables[5] =
        new TableBuilder()
            .setDbName(DEFAULT_DATABASE)
            .setTableName("filter_test_table_5")
            .addCol("test_col", "int")
            .create(client, metaStore.getConf());

    new DatabaseBuilder().setName(OTHER_DATABASE).create(client, metaStore.getConf());

    testTables[6] =
        new TableBuilder()
            .setDbName(OTHER_DATABASE)
            .setTableName("filter_test_table_0")
            .addCol("test_col", "int")
            .setOwner("Owner1")
            .setLastAccessTime(1000)
            .addTableParam("param1", "value1")
            .create(client, metaStore.getConf());

    // Reload tables from the MetaStore
    for(int i=0; i < testTables.length; i++) {
      testTables[i] = client.getTable(testTables[i].getCatName(), testTables[i].getDbName(),
          testTables[i].getTableName());
    }
  }
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/TestTablesList.java