@Test
  public void testShowTablesInDb() throws SQLException {
    Statement stmt = con.createStatement();
    assertNotNull("Statement is null", stmt);

    String tableNameInDbUnique = tableName + "_unique";
    String fullTestTableName = StatsUtils.getFullyQualifiedTableName(testDbName, tableNameInDbUnique);
    // create a table with a unique name in testDb
    stmt.execute("drop table if exists " + fullTestTableName);
    stmt.execute("create table " + fullTestTableName
        + " (under_col int comment 'the under column', value string) comment '" + tableComment
        + "'");

    ResultSet res = stmt.executeQuery("show tables in " + testDbName);

    boolean testTableExists = false;
    while (res.next()) {
      assertNotNull("table name is null in result set", res.getString(1));
      if (tableNameInDbUnique.equalsIgnoreCase(res.getString(1))) {
        testTableExists = true;
      }
    }
    assertTrue("table name " + tableNameInDbUnique
        + " not found in SHOW TABLES result set", testTableExists);
    stmt.execute("drop table if exists " + fullTestTableName);
    stmt.close();
  }
Execute "set x" and extract value from key=val format result
Verify the extracted value
@param key
@param expectedVal
@throws Exception
itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java