BusinessAnalyzer extends AbstractMessageAnalyzer<BusinessReport> implements LogEnabled { @Override protected void process(MessageTree tree) { String domain = tree.getDomain(); BusinessReport report = m_reportManager.getHourlyReport(getStartTime(), domain, true); List<Metric> metrics = tree.getMetrics(); for (Metric metric : metrics) { processMetric(report, metric, domain); } }  @Override void doCheckpoint(boolean atEnd); @Override void enableLogging(Logger logger); @Override BusinessReport getReport(String domain); @Override ReportManager<BusinessReport> getReportManager(); @Override boolean isEligable(MessageTree tree); static final String ID; }
@Test public void testProcess() throws Exception { for (int i = 1; i <= 60; i++) { MessageTree tree = ((DefaultMessageTree) generateMessageTree(i)).copyForTest(); m_analyzer.process(tree); } BusinessReport report = m_analyzer.getReport(m_domain); String expected = Files.forIO().readFrom(getClass().getResourceAsStream("business_analyzer.xml"), "utf-8"); Assert.assertEquals(expected.replaceAll("\r", ""), report.toString().replaceAll("\r", "")); }