@Test
public void testHDFSConfigExported() throws Exception {

  final String expectedHostName = "c6401.apache.ambari.org";
  final String expectedPortNum = "808080";
  final String expectedHostGroupName = "host_group_1";
  Map<String, Map<String, String>> configProperties = new HashMap<String, Map<String, String>>();
  Map<String, String> hdfsSiteProperties = new HashMap<String, String>();
  Map<String, String> coreSiteProperties = new HashMap<String, String>();
  Map<String, String> hbaseSiteProperties = new HashMap<String, String>();
  Map<String, String> accumuloSiteProperties = new HashMap<String, String>();
  configProperties.put("hdfs-site", hdfsSiteProperties);
  configProperties.put("core-site", coreSiteProperties);
  configProperties.put("hbase-site", hbaseSiteProperties);
  configProperties.put("accumulo-site", accumuloSiteProperties);
  // setup properties that include host information
  hdfsSiteProperties.put("dfs.http.address", expectedHostName + ":" + expectedPortNum);
  hdfsSiteProperties.put("dfs.https.address", expectedHostName + ":" + expectedPortNum);
  hdfsSiteProperties.put("dfs.namenode.http-address", expectedHostName + ":" + expectedPortNum);
  hdfsSiteProperties.put("dfs.namenode.https-address", expectedHostName + ":" + expectedPortNum);
  hdfsSiteProperties.put("dfs.secondary.http.address", expectedHostName + ":" + expectedPortNum);
  hdfsSiteProperties.put("dfs.namenode.secondary.http-address", expectedHostName + ":" + expectedPortNum);
  hdfsSiteProperties.put("dfs.namenode.shared.edits.dir", expectedHostName + ":" + expectedPortNum);
  coreSiteProperties.put("fs.default.name", expectedHostName + ":" + expectedPortNum);
  coreSiteProperties.put("fs.defaultFS", "hdfs://" + expectedHostName + ":" + expectedPortNum);
  hbaseSiteProperties.put("hbase.rootdir", "hdfs://" + expectedHostName + ":" + expectedPortNum + "/apps/hbase/data");
  accumuloSiteProperties.put("instance.volumes", "hdfs://" + expectedHostName + ":" + expectedPortNum + "/apps/accumulo/data");
  Configuration clusterConfig = new Configuration(configProperties,
      Collections.<String, Map<String, Map<String, String>>>emptyMap());
  // note: test hostgroups may not accurately reflect the required components for the config properties
  // which are mapped to them.  Only the hostgroup name is used for hostgroup resolution an the components
  // are not validated
  Collection<String> groupComponents = new HashSet<String>();
  groupComponents.add("NAMENODE");
  groupComponents.add("SECONDARY_NAMENODE");
  Collection<String> hosts = new ArrayList<String>();
  hosts.add(expectedHostName);
  hosts.add("serverTwo");
  TestHostGroup group = new TestHostGroup(expectedHostGroupName, groupComponents, hosts);
  Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>();
  hostGroups.add(group);
  ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups);
  BlueprintConfigurationProcessor configProcessor = new BlueprintConfigurationProcessor(topology);
  configProcessor.doUpdateForBlueprintExport();
  assertEquals("hdfs config property not exported properly",
    createExportedAddress(expectedPortNum, expectedHostGroupName), hdfsSiteProperties.get("dfs.http.address"));
  assertEquals("hdfs config property not exported properly",
      createExportedAddress(expectedPortNum, expectedHostGroupName), hdfsSiteProperties.get("dfs.https.address"));
  assertEquals("hdfs config property not exported properly",
      createExportedAddress(expectedPortNum, expectedHostGroupName), hdfsSiteProperties.get("dfs.namenode.http-address"));
  assertEquals("hdfs config property not exported properly",
      createExportedAddress(expectedPortNum, expectedHostGroupName), hdfsSiteProperties.get("dfs.namenode.https-address"));
  assertEquals("hdfs config property not exported properly",
      createExportedAddress(expectedPortNum, expectedHostGroupName), hdfsSiteProperties.get("dfs.secondary.http.address"));
  assertEquals("hdfs config property not exported properly",
      createExportedAddress(expectedPortNum, expectedHostGroupName), hdfsSiteProperties.get("dfs.namenode.secondary.http-address"));
  assertEquals("hdfs config property not exported properly",
      createExportedAddress(expectedPortNum, expectedHostGroupName), hdfsSiteProperties.get("dfs.namenode.shared.edits.dir"));
  assertEquals("hdfs config in core-site not exported properly",
      createExportedAddress(expectedPortNum, expectedHostGroupName), coreSiteProperties.get("fs.default.name"));
  assertEquals("hdfs config in core-site not exported properly",
      "hdfs://" + createExportedAddress(expectedPortNum, expectedHostGroupName), coreSiteProperties.get("fs.defaultFS"));
  assertEquals("hdfs config in hbase-site not exported properly",
      "hdfs://" + createExportedAddress(expectedPortNum, expectedHostGroupName) + "/apps/hbase/data", hbaseSiteProperties.get("hbase.rootdir"));
  assertEquals("hdfs config in accumulo-site not exported properly",
      "hdfs://" + createExportedAddress(expectedPortNum, expectedHostGroupName) + "/apps/accumulo/data", accumuloSiteProperties.get("instance.volumes"));
}