IOException {
assertEquals(0, flumeMaster.getSpecMan().getAllConfigs().size());
String nodename = "bar";
flumeMaster.getSpecMan().addLogicalNode(nodename, "foo");
FlumeNode n = new FlumeNode(FlumeConfiguration.get(), nodename,
new DirectMasterRPC(flumeMaster), false, false);
n.start();
// jumpstart the heartbeat (get foo register, and its default logicalNode
// started)
n.getLivenessManager().heartbeatChecks();
// One for the logical node by default, one for foo
assertEquals(2, flumeMaster.getStatMan().getNodeStatuses().size());
FlumeShell sh = new FlumeShell();
sh.executeLine("connect localhost: "
+ FlumeConfiguration.DEFAULT_ADMIN_PORT);
sh
.executeLine("exec config foo 'synth(100)' '{delay(100) => accumulator(\"count\") }' ");
FlumeConfigData fcd = flumeMaster.getSpecMan().getConfig("foo");
assertEquals("{delay(100) => accumulator(\"count\") }", fcd.sinkConfig);
assertEquals("synth(100)", fcd.sourceConfig);
assertTrue(0 != fcd.timestamp);
sh.executeLine("waitForNodesDone 0 foo");
n.getLivenessManager().heartbeatChecks();
NodeState status = flumeMaster.getStatMan().getNodeStatuses().get("foo").state;
NodeState idle = NodeState.IDLE;
assertEquals(status, idle);
// TODO: uncomment when there is a clean way to get at the reportable
n.stop();
}