private void verifyConfValue(Connection con, String key, String expectedVal) throws Exception {
    Statement stmt = con.createStatement();
    ResultSet res = stmt.executeQuery("set " + key);
    assertTrue(res.next());
    String value = res.getString(1);
    String resultValues[] = value.split("="); // "key = 'val'"
    assertEquals("Result not in key = val format: " + value, 2, resultValues.length);
    if (resultValues[1].startsWith("'") && resultValues[1].endsWith("'")) {
      resultValues[1] = resultValues[1].substring(1, resultValues[1].length() -1); // remove '
    }
    assertEquals("Conf value should be set by execute()", expectedVal, resultValues[1]);
  }
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