private TableMeta createTestTable(String dbName, String tableName, TableType type, String comment,
      OwnerInfo ownerInfo) throws Exception {
    String owner = ownerInfo == null ? TABLE_OWNER : ownerInfo.owner;
    PrincipalType ownerType = ownerInfo == null ? TABLE_OWNER_TYPE : ownerInfo.ownerType;
    Table table = createTable(dbName, tableName, type, owner, ownerType);
    TableMeta expectedTableMeta = new TableMeta(dbName, tableName, type.toString());
    if (comment != null) {
      table.getParameters().put("comment", comment);
      expectedTableMeta.setComments(comment);
    }
    expectedTableMeta.setOwnerName(owner);
    expectedTableMeta.setOwnerType(ownerType);
    expectedTableMeta.setCatName("hive");
    client.createTable(table);
    return expectedTableMeta;

  }
API tests for HMS client's getTableMeta method.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestGetTableMeta.java