@Test
  public void testAppendRestriction() throws Exception {
    String appendListStr = ConfVars.SCRATCH_DIR.varname + "," +
        ConfVars.LOCAL_SCRATCH_DIR.varname + "," +
        ConfVars.METASTORE_URIS.varname;

    conf.addToRestrictList(appendListStr);
    // check if the new configs are added to HIVE_CONF_RESTRICTED_LIST
    String newRestrictList = conf.getVar(ConfVars.HIVE_CONF_RESTRICTED_LIST);
    assertTrue(newRestrictList.contains(ConfVars.SCRATCH_DIR.varname));
    assertTrue(newRestrictList.contains(ConfVars.LOCAL_SCRATCH_DIR.varname));
    assertTrue(newRestrictList.contains(ConfVars.METASTORE_URIS.varname));

    // check if the old values are still there in HIVE_CONF_RESTRICTED_LIST
    assertTrue(newRestrictList.contains(ConfVars.HIVE_TEST_MODE_PREFIX.varname));

    // verify that the new configs are in effect
    verifyRestriction(ConfVars.HIVE_TEST_MODE_PREFIX.varname, "foo");
    verifyRestriction(ConfVars.HIVE_CONF_RESTRICTED_LIST.varname, "foo");
    verifyRestriction(ConfVars.LOCAL_SCRATCH_DIR.varname, "foo");
    verifyRestriction(ConfVars.METASTORE_URIS.varname, "foo");
  }
Test appending new configs vars added to restrict list
@throws Exception
common/src/test/org/apache/hadoop/hive/conf/TestHiveConfRestrictList.java