private void checkResultSetExpected(Statement stmt, List<String> setupQueries, String testQuery,
      boolean isExpectedResultSet) throws Exception {
    boolean hasResultSet;
    // execute the setup queries
    for(String setupQuery: setupQueries) {
      try {
        stmt.execute(setupQuery);
      } catch (Exception e) {
        failWithExceptionMsg(e);
      }
    }
    // execute the test query
    try {
      hasResultSet = stmt.execute(testQuery);
      assertEquals(hasResultSet, isExpectedResultSet);
    }
    catch(Exception e) {
      failWithExceptionMsg(e);
    }
  }
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/cbo_rp_TestJdbcDriver2.java