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

Examples of com.dianping.cat.consumer.problem.model.entity.ProblemReport.accept()


    for (; startTime < endTime; startTime += TimeHelper.ONE_DAY) {
      try {
        ProblemReport reportModel = m_reportService.queryProblemReport(domain, new Date(startTime), new Date(
              startTime + TimeHelper.ONE_DAY));
        reportModel.accept(merger);
      } catch (Exception e) {
        Cat.logError(e);
      }
    }
    ProblemReport problemReport = merger.getProblemReport();
View Full Code Here


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

        if (model != null) {
          model.accept(merger);
        }
      }
    }

    return merger.getProblemReport();
View Full Code Here

    ProblemReport reportNew = DefaultSaxParser.parse(newXml);
    String expected = Files.forIO().readFrom(getClass().getResourceAsStream("ProblemReportMergeResult.xml"), "utf-8");
    ProblemReportMerger merger = new ProblemReportMerger(new ProblemReport(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.getProblemReport().toString()
          .replace("\r", ""));
View Full Code Here

    String expected = Files.forIO().readFrom(getClass().getResourceAsStream("ProblemReportMergeAllResult.xml"),
          "utf-8");
    ProblemReportMerger merger = new HistoryProblemReportMerger(new ProblemReport(reportOld.getDomain()));

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

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

    String oldXml = Files.forIO().readFrom(getClass().getResourceAsStream("ProblemMobile.xml"), "utf-8");
    ProblemReport reportOld = DefaultSaxParser.parse(oldXml);
    ProblemReportMerger merger = new HistoryProblemReportMerger(new ProblemReport(reportOld.getDomain()));

    for (int i = 0; i < 24; i++) {
      reportOld.accept(merger);
    }
    ProblemReport problemReport = merger.getProblemReport();
    for (Machine machine : problemReport.getMachines().values()) {
      List<Entry> entries = machine.getEntries();
      for (Entry entry : entries) {
View Full Code Here

        String xml = report.getContent();

        if (xml != null && xml.length() > 0) {
          ProblemReport reportModel = com.dianping.cat.consumer.problem.model.transform.DefaultSaxParser
                .parse(xml);
          reportModel.accept(merger);
        } else {
          ProblemReport reportModel = queryFromDailyBinary(report.getId(), domain);

          reportModel.accept(merger);
        }
View Full Code Here

                .parse(xml);
          reportModel.accept(merger);
        } else {
          ProblemReport reportModel = queryFromDailyBinary(report.getId(), domain);

          reportModel.accept(merger);
        }
      } catch (DalNotFoundException e) {
        //ignore
      } catch (Exception e) {
        Cat.logError(e);
View Full Code Here

          try {
            if (xml != null && xml.length() > 0) {// for old xml storage
              ProblemReport reportModel = com.dianping.cat.consumer.problem.model.transform.DefaultSaxParser
                    .parse(xml);
              reportModel.accept(merger);
            } else {// for new binary storage, binary is same to report id
              ProblemReport reportModel = queryFromHourlyBinary(report.getId(), domain);

              reportModel.accept(merger);
            }
View Full Code Here

                    .parse(xml);
              reportModel.accept(merger);
            } else {// for new binary storage, binary is same to report id
              ProblemReport reportModel = queryFromHourlyBinary(report.getId(), domain);

              reportModel.accept(merger);
            }
          } catch (DalNotFoundException e) {
            //ignore
          } catch (Exception e) {
            Cat.logError(e);
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.