Package com.google.test.metric.report

Examples of com.google.test.metric.report.ReportModel


  ByteArrayOutputStream out = new ByteArrayOutputStream();
  HypotheticalCostModel costModel = new HypotheticalCostModel(new CostModel());

  public void testExample() throws Exception {
    IssuesReporter reporter = new IssuesReporter(new LinkedList<ClassIssues>(), costModel);
    ReportModel model = new AboutTestabilityReport(reporter, new SourceLoader(null) {
      @Override
      public Source load(String name) {
        return new Source(asList(
            new Line(1, "Copyright garbage!"),
            new Line(2, "package com.google.test.metric.example;"),
            new Line(3, "import java.util.List;"),
            new Line(4, "  "),
            new Line(5, "class SumOfPrimes {"),
            new Line(6, "  public void sum() {}"),
            new Line(7, "}")));
      }
    });
    Configuration configuration = new Configuration();
    configuration.setTemplateLoader(new ClassPathTemplateLoader(ReportGeneratorProvider.PREFIX));
    BeansWrapper objectWrapper = new DefaultObjectWrapper();
    configuration.setObjectWrapper(objectWrapper);
    ResourceBundleModel bundleModel = new ResourceBundleModel(getBundle("messages"), objectWrapper);
    model.setMessageBundle(bundleModel);
    generator = new FreemarkerReportGenerator(model, new PrintStream(out),
            "about/Report.html", configuration);
    generator.printHeader();
    generator.addClassCost(new ClassCost("com.google.test.metric.example.Lessons.SumOfPrimes1",
        asList(new MethodCost("", "foo()", 1, false, false, false))));
View Full Code Here


      ReportOptions options = new ReportOptions(cyclomaticCost, globalCost, constructorMultiplier,
          maxExcellentCost, maxAcceptableCost, maxClassesInReport, -1, -1, printDepth, -1, "", "");
      SourceLoader sourceLoader = new SourceLoader(classPath);

      AnalysisModel analysisModel = new AnalysisModel(issuesReporter);
      ReportModel reportModel = new HtmlReportModel(costModel, analysisModel, options);
      ReportGenerator report = new ReportGeneratorProvider(classPath, options,
          reportStream, hypotheticalCostModel, ReportFormat.html).build(costModel, reportModel, sourceLoader);

      new JavaTestabilityRunner(report, classPath, classRepository, computer, allJavaPackages, whitelist, errorStream).run();
View Full Code Here

            options.getWorstOffenderCount(), new ClassIssues.TotalCostComparator());
    SourceLoader sourceLoader = new SourceLoader(classPath);

    IssuesReporter issuesReporter = new IssuesReporter(mostImportantIssues, hypotheticalCostModel);
    AnalysisModel analysisModel = new AnalysisModel(issuesReporter);
    ReportModel reportModel;

    switch (reportFormat) {
      case html:
        reportModel = new HtmlReportModel(costModel, analysisModel, options);
        break;
View Full Code Here

TOP

Related Classes of com.google.test.metric.report.ReportModel

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.