@Test
  public void testDeprecatedConfigs() throws Exception {
    Configuration conf = TEST_UTIL.getConfiguration();
    new HRegionServer(conf);
    conf.setBoolean(HRegionServer.RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY, false);
    assertFalse(
      conf.getBoolean(HRegionServer.UNSAFE_RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY, true));
    conf.setBoolean(HRegionServer.RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY, true);
    assertTrue(
      conf.getBoolean(HRegionServer.UNSAFE_RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY, false));
    conf.setBoolean(HRegionServer.UNSAFE_RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY, true);
    assertTrue(conf.getBoolean(HRegionServer.RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY, false));
    conf.setBoolean(HRegionServer.UNSAFE_RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY, false);
    assertFalse(conf.getBoolean(HRegionServer.RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY, true));

    conf.setBoolean(DNS.RS_HOSTNAME_KEY, false);
    assertFalse(conf.getBoolean(DNS.UNSAFE_RS_HOSTNAME_KEY, true));
    conf.setBoolean(DNS.RS_HOSTNAME_KEY, true);
    assertTrue(conf.getBoolean(DNS.UNSAFE_RS_HOSTNAME_KEY, false));
    conf.setBoolean(DNS.UNSAFE_RS_HOSTNAME_KEY, true);
    assertTrue(conf.getBoolean(DNS.RS_HOSTNAME_KEY, false));
    conf.setBoolean(DNS.UNSAFE_RS_HOSTNAME_KEY, false);
    assertFalse(conf.getBoolean(DNS.RS_HOSTNAME_KEY, true));
  }
Tests for the hostname specification by region server
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerHostname.java