@Test
  public void testTableExists() throws Exception {
    // Using the second table, since a table called "test_table" exists in both databases
    Table table = testTables[1];

    Assert.assertTrue("Table exists", client.tableExists(table.getCatName(), table.getDbName(),
        table.getTableName()));
    Assert.assertFalse("Table not exists", client.tableExists(table.getCatName(), table.getDbName(),
        "non_existing_table"));

    // No such database
    Assert.assertFalse("Table not exists", client.tableExists("no_such_database",
        table.getTableName()));

    // No such table in the given database
    Assert.assertFalse("Table not exists", client.tableExists(OTHER_DATABASE,
        table.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/TestTablesGetExists.java