@Test
  public void tablesInDifferentCatalog() throws TException {
    String catName = "get_table_meta_catalog";
    Catalog cat = new CatalogBuilder()
        .setName(catName)
        .setLocation(MetaStoreTestUtils.getTestWarehouseDir(catName))
        .build();
    client.createCatalog(cat);

    String dbName = "db9";
    // For this one don't specify a location to make sure it gets put in the catalog directory
    Database db = new DatabaseBuilder()
        .setName(dbName)
        .setCatalogName(catName)
        .create(client, metaStore.getConf());

    String[] tableNames = {"table_in_other_catalog_1", "table_in_other_catalog_2", "random_name"};
    List<TableMeta> expected = new ArrayList<>(tableNames.length);
    for (int i = 0; i < tableNames.length; i++) {
      client.createTable(new TableBuilder()
          .inDb(db)
          .setTableName(tableNames[i])
          .setOwner(TABLE_OWNER)
          .setOwnerType(TABLE_OWNER_TYPE)
          .addCol("id", "int")
          .addCol("name", "string")
          .build(metaStore.getConf()));
      Table table = client.getTable(catName, dbName, tableNames[i]);
      TableMeta tableMeta = new TableMeta(dbName, tableNames[i], table.getTableType());
      tableMeta.setCatName(catName);
      tableMeta.setOwnerName(TABLE_OWNER);
      tableMeta.setOwnerType(TABLE_OWNER_TYPE);
      expected.add(tableMeta);
    }

    List<String> typesList = Lists.newArrayList(TableType.MANAGED_TABLE.name(),
        TableType.EXTERNAL_TABLE.name());
    List<String> types = Collections.unmodifiableList(typesList);
    List<TableMeta> actual = client.getTableMeta(catName, dbName, "*", types);
    assertTableMetas(expected, actual, 0, 1, 2);

    actual = client.getTableMeta(catName, "*", "table_*", types);
    assertTableMetas(expected, actual, 0, 1);

    actual = client.getTableMeta(dbName, "table_in_other_catalog_*", types);
    assertTableMetas(expected, actual);
  }
Testing getTableMeta(String,String,List(String)) ->
        get_table_meta(String,String,List(String)).
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestGetTableMeta.java