@Test
public void testPrepareDAG()
{

  final MutableBoolean appInitialized = new MutableBoolean(false);
  StreamingApplication app = new StreamingApplication()
  {
    @Override
    public void populateDAG(DAG dag, Configuration conf)
    {
      Assert.assertEquals("", "hostname:9090", dag.getValue(DAG.GATEWAY_CONNECT_ADDRESS));
      dag.setAttribute(DAG.GATEWAY_CONNECT_ADDRESS, "hostname:9091");
      appInitialized.setValue(true);
    }
  };
  Configuration conf = new Configuration(false);
  conf.addResource(StramClientUtils.DT_SITE_XML_FILE);
  LogicalPlanConfiguration pb = new LogicalPlanConfiguration(conf);
  LogicalPlan dag = new LogicalPlan();
  pb.prepareDAG(dag, app, "testconfig");
  Assert.assertTrue("populateDAG called", appInitialized.booleanValue());
  Assert.assertEquals("populateDAG overrides attribute", "hostname:9091", dag.getValue(DAG.GATEWAY_CONNECT_ADDRESS));
}