TTransportException, IOException {
assertEquals(0, flumeMaster.getSpecMan().getAllConfigs().size());
String nodename = "foo";
FlumeConfiguration conf = FlumeConfiguration.createTestableConfiguration();
FlumeNode n = new FlumeNode(conf, nodename,
new DirectMasterRPC(flumeMaster), false, false);
n.start();
String node2 = "bar";
FlumeNode n2 = new FlumeNode(conf, node2, new DirectMasterRPC(flumeMaster),
false, false);
n2.start();
String node3 = "baz";
FlumeNode n3 = new FlumeNode(conf, node3, new DirectMasterRPC(flumeMaster),
false, false);
n3.start();
// jumpstart the heartbeat (get foo register, and its default logicalNode
// started)
n.getLivenessManager().heartbeatChecks();
n2.getLivenessManager().heartbeatChecks();
n3.getLivenessManager().heartbeatChecks();
assertEquals(3, 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\") }' ");
sh
.executeLine("exec config bar 'synth(50)' '{delay(100) => accumulator(\"count2\") }' ");
sh
.executeLine("exec config baz 'synth(75)' '{delay(100) => accumulator(\"count3\") }' ");
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 bar baz");
n.getLivenessManager().heartbeatChecks();
NodeState status = flumeMaster.getStatMan().getNodeStatuses().get(nodename).state;
NodeState idle = NodeState.IDLE;
assertEquals(status, idle);
AccumulatorSink cnt = (AccumulatorSink) ReportManager.get().getReportable(
"count");
assertEquals(100, cnt.getCount());
AccumulatorSink cnt2 = (AccumulatorSink) ReportManager.get().getReportable(
"count2");
assertEquals(50, cnt2.getCount());
AccumulatorSink cnt3 = (AccumulatorSink) ReportManager.get().getReportable(
"count3");
assertEquals(75, cnt3.getCount());
n.stop();
n2.stop();
n3.stop();
}