@Test
public void testPropertyWithUndefinedHostisExported() throws Exception {

  final String expectedHostName = "c6401.apache.ambari.org";
  final String expectedHostGroupName = "host_group_1";
  Map<String, Map<String, String>> configProperties = new HashMap<String, Map<String, String>>();
  Map<String, String> properties = new HashMap<String, String>();
  configProperties.put("storm-site", properties);
  // setup properties that include host information including undefined host properties
  properties.put("storm.zookeeper.servers", expectedHostName);
  properties.put("nimbus.childopts", "undefined");
  properties.put("worker.childopts", "some other info, undefined, more info");
  Configuration clusterConfig = new Configuration(configProperties,
      Collections.<String, Map<String, Map<String, String>>>emptyMap());
  Collection<String> groupComponents = new HashSet<String>();
  groupComponents.add("ZOOKEEPER_SERVER");
  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);
  // call top-level export method
  configProcessor.doUpdateForBlueprintExport();
  assertEquals("Property was incorrectly exported",
      "%HOSTGROUP::" + expectedHostGroupName + "%", properties.get("storm.zookeeper.servers"));
  assertEquals("Property with undefined host was incorrectly exported",
    "undefined", properties.get("nimbus.childopts"));
  assertEquals("Property with undefined host was incorrectly exported",
    "some other info, undefined, more info", properties.get("worker.childopts"));
}