}
@Test
public void testReports() throws TException, IOException {
FlumeConfiguration.createTestableConfiguration();
ReportManager rptMan = ReportManager.get();
rptMan.clear();
FlumeConfiguration.get().set(FlumeConfiguration.WEBAPPS_PATH,
"build/webapps");
FlumeConfiguration.get().set(FlumeConfiguration.MASTER_STORE, "memory");
FlumeConfiguration.get().setInt(FlumeConfiguration.MASTER_HEARTBEAT_PORT, 55556);
FlumeMaster master = new FlumeMaster(new CommandManager(),
new ConfigManager(), new StatusManager(), new MasterAckManager(),
FlumeConfiguration.get());
MasterClientServer delegate = new MasterClientServer(master, cfg);
delegate.masterRPC.serve();
ReportEvent r = new ReportEvent("foo");
r.setStringMetric("bar", "baz");
Map<String, ReportEvent> rptMap = new HashMap<String, ReportEvent>();
rptMap.put("test-report", r);
delegate.putReports(rptMap);
Map<String, Reportable> reportables = rptMan.getReportables();
delegate.stop();
assertEquals(1, reportables.size());
assertNotNull(reportables.get("test-report"));