TopAnalyzer extends AbstractMessageAnalyzer<TopReport> implements LogEnabled { @Override public void process(MessageTree tree) { String domain = tree.getDomain(); if (m_serverFilterConfigManager.validateDomain(domain)) { TopReport report = m_reportManager.getHourlyReport(getStartTime(), Constants.CAT, true); List<Event> events = tree.getEvents(); for (Event e : events) { processEvent(report, tree, e); } } }  @Override synchronized void doCheckpoint(boolean atEnd); @Override void enableLogging(Logger logger); @Override TopReport getReport(String domain); @Override ReportManager<TopReport> getReportManager(); @Override boolean isEligable(MessageTree tree); @Override void process(MessageTree tree); void setErrorType(String type); static final String ID; }
@Test public void testProcess() throws Exception { for (int i = 1; i <= 100; i++) { MessageTree tree = ((DefaultMessageTree) generateMessageTree(i)).copyForTest(); m_analyzer.process(tree); } TopReport report = m_analyzer.getReport(m_domain); String expected = Files.forIO().readFrom(getClass().getResourceAsStream("top_analyzer.xml"), "utf-8"); Assert.assertEquals(expected.replaceAll("\r", ""), report.toString().replaceAll("\r", "")); }