Package com.dianping.cat.consumer.heartbeat.model.entity

Examples of com.dianping.cat.consumer.heartbeat.model.entity.HeartbeatReport.accept()


          try {
            if (xml != null && xml.length() > 0) {
              HeartbeatReport reportModel = com.dianping.cat.consumer.heartbeat.model.transform.DefaultSaxParser
                    .parse(xml);
              reportModel.accept(merger);
            } else {
              HeartbeatReport reportModel = queryFromHourlyBinary(report.getId(), domain);
              reportModel.accept(merger);
            }
          } catch (DalNotFoundException e) {
View Full Code Here


              HeartbeatReport reportModel = com.dianping.cat.consumer.heartbeat.model.transform.DefaultSaxParser
                    .parse(xml);
              reportModel.accept(merger);
            } else {
              HeartbeatReport reportModel = queryFromHourlyBinary(report.getId(), domain);
              reportModel.accept(merger);
            }
          } catch (DalNotFoundException e) {
            //ignore
          } catch (Exception e) {
            Cat.logError(e);
View Full Code Here

    for (ModelResponse<HeartbeatReport> response : responses) {
      if (response != null) {
        HeartbeatReport model = response.getModel();

        if (model != null) {
          model.accept(merger);
        }
      }
    }
    return merger.getHeartbeatReport();
  }
View Full Code Here

  public void testModel() throws Exception {
    String newXml = Files.forIO().readFrom(getClass().getResourceAsStream("heartbeat.xml"), "utf-8");
    HeartbeatReport reportOld = DefaultSaxParser.parse(newXml);
    HeartbeatReportMerger merger = new HeartbeatReportMerger(new HeartbeatReport(reportOld.getDomain()));

    reportOld.accept(merger);
    Assert.assertEquals(newXml.replaceAll("\r", ""), reportOld.toString().replaceAll("\r", ""));
  }

  @Test
  public void test1() throws Exception {
View Full Code Here

    HeartbeatReport reportNew = DefaultSaxParser.parse(newXml);
    String expected = Files.forIO().readFrom(getClass().getResourceAsStream("heartbeat_analyzer_merge.xml"), "utf-8");
    HeartbeatReportMerger merger = new HeartbeatReportMerger(new HeartbeatReport(reportOld.getDomain()));

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

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

TOP
Copyright © 2018 www.massapi.com. 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.