Package com.dianping.cat.report.task.state

Examples of com.dianping.cat.report.task.state.HistoryStateReportMerger


    StateReport reportOld = DefaultSaxParser.parse(oldXml);
    StateReport reportNew = DefaultSaxParser.parse(newXml);
    String expected = Files.forIO()
          .readFrom(getClass().getResourceAsStream("historyResult.xml"), "utf-8");
   
    HistoryStateReportMerger merger = new HistoryStateReportMerger(new StateReport(reportOld.getDomain()));

    reportOld.accept(merger);
    reportNew.accept(merger);

    Assert.assertEquals("Check the merge result!", expected.replaceAll("\r", ""), merger.getStateReport()
          .toString().replaceAll("\r", ""));
    Assert.assertEquals("Source report is changed!", newXml.replaceAll("\r", ""),
          reportNew.toString().replaceAll("\r", ""));
    Assert.assertEquals("Source report is changed!", oldXml.replaceAll("\r", ""),
          reportOld.toString().replaceAll("\r", ""));
View Full Code Here


  public void testStateReportBuilder() throws Exception {
    ReportServiceManager service = lookup(ReportServiceManager.class);
    Date date = TimeHelper.getCurrentMonth();
    long start = date.getTime();
    long end = System.currentTimeMillis();
    HistoryStateReportMerger merger = new HistoryStateReportMerger(new StateReport("cat"));

    for (; start < end; start = start + TimeHelper.ONE_DAY) {
      StateReport stateReport = service.queryStateReport("cat", new Date(start), new Date(start + TimeHelper.ONE_DAY));

      stateReport.accept(merger);
    }
    StateReport report = merger.getStateReport();
    new ClearDetailInfo().visitStateReport(report);
  }
View Full Code Here

TOP

Related Classes of com.dianping.cat.report.task.state.HistoryStateReportMerger

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.