@Test
  public void testLockedConfig() throws Exception {
    HiveConf conf = new HiveConf();
    // Set the default value of the config
    conf.setVar(ConfVars.HIVE_EXECUTION_ENGINE, "mr");
    String defaultVal = conf.get(ConfVars.HIVE_EXECUTION_ENGINE.varname);
    // Update the lockedSet variable
    conf.addToLockedSet(ConfVars.HIVE_EXECUTION_ENGINE.varname);
    // Update the value of sample/test config
    conf.verifyAndSet(ConfVars.HIVE_EXECUTION_ENGINE.varname, "tez");
    String modifiedVal = conf.get(ConfVars.HIVE_EXECUTION_ENGINE.varname);
    // Check if the value is changed.
    Assert.assertEquals(defaultVal, modifiedVal);
  }
TestHiveConf

Test cases for HiveConf. Loads configuration files located
in common/src/test/resources.
common/src/test/org/apache/hadoop/hive/conf/TestHiveConf.java