@Test
  public void testConfProperties() throws Exception {
    // Make sure null-valued ConfVar properties do not override the Hadoop Configuration
    // NOTE: Comment out the following test case for now until a better way to test is found,
    // as this test case cannot be reliably tested. The reason for this is that Hive does
    // overwrite fs.default.name in HiveConf if the property is set in system properties.
    // checkHadoopConf(ConfVars.HADOOPFS.varname, "core-site.xml");
    // checkConfVar(ConfVars.HADOOPFS, null);
    // checkHiveConf(ConfVars.HADOOPFS.varname, "core-site.xml");

    // Make sure non-null-valued ConfVar properties *do* override the Hadoop Configuration
    checkHadoopConf(ConfVars.HADOOP_NUM_REDUCERS.varname, "1");
    checkConfVar(ConfVars.HADOOP_NUM_REDUCERS, "-1");
    checkHiveConf(ConfVars.HADOOP_NUM_REDUCERS.varname, "-1");

    // Non-null ConfVar only defined in ConfVars
    checkHadoopConf(ConfVars.HIVE_SKEWJOIN_KEY.varname, null);
    checkConfVar(ConfVars.HIVE_SKEWJOIN_KEY, "100000");
    checkHiveConf(ConfVars.HIVE_SKEWJOIN_KEY.varname, "100000");

    // ConfVar overridden in in hive-site.xml
    checkHadoopConf(ConfVars.HIVE_TEST_MODE_DUMMY_STAT_AGGR.varname, null);
    checkConfVar(ConfVars.HIVE_TEST_MODE_DUMMY_STAT_AGGR, "");
    checkHiveConf(ConfVars.HIVE_TEST_MODE_DUMMY_STAT_AGGR.varname, "value2");

    //Property defined for hive masking algorithm
    checkConfVar(ConfVars.HIVE_MASKING_ALGO, "sha256");
    checkHiveConf(ConfVars.HIVE_MASKING_ALGO.varname, "sha256");

    // Property defined in hive-site.xml only
    checkHadoopConf("test.property1", null);
    checkHiveConf("test.property1", "value1");

    // Test HiveConf property variable substitution in hive-site.xml
    checkHiveConf("test.var.hiveconf.property", ConfVars.DEFAULT_PARTITION_NAME.getDefaultValue());
  }
TestHiveConf

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