예제 #1
0
 public void generateTagOverview() throws Exception {
   VelocityEngine ve = new VelocityEngine();
   ve.init(getProperties());
   Template featureOverview = ve.getTemplate("templates/tagOverview.vm");
   VelocityContext context = new VelocityContext();
   context.put("build_project", buildProject);
   context.put("build_number", buildNumber);
   context.put("tags", ri.getTags());
   context.put("total_tags", ri.getTotalTags());
   context.put("total_scenarios", ri.getTotalTagScenarios());
   context.put("total_steps", ri.getTotalTagSteps());
   context.put("total_passes", ri.getTotalTagPasses());
   context.put("total_fails", ri.getTotalTagFails());
   context.put("total_skipped", ri.getTotalTagSkipped());
   context.put("total_pending", ri.getTotalTagPending());
   if (flashCharts) {
     context.put("chart_data", FlashChartBuilder.StackedColumnChart(ri.tagMap));
   } else {
     context.put("chart_rows", JsChartUtil.generateTagChartData(ri.tagMap));
   }
   context.put("total_duration", ri.getTotalTagDuration());
   context.put("time_stamp", ri.timeStamp());
   context.put("jenkins_base", pluginUrlPath);
   context.put("fromJenkins", runWithJenkins);
   context.put("flashCharts", flashCharts);
   generateReport("tag-overview.html", featureOverview, context);
 }
예제 #2
0
 public void generateTagReports() throws Exception {
   for (TagObject tagObject : ri.getTags()) {
     VelocityEngine ve = new VelocityEngine();
     ve.init(getProperties());
     Template featureResult = ve.getTemplate("templates/tagReport.vm");
     VelocityContext context = new VelocityContext();
     context.put("tag", tagObject);
     context.put("time_stamp", ri.timeStamp());
     context.put("jenkins_base", pluginUrlPath);
     context.put("build_project", buildProject);
     context.put("build_number", buildNumber);
     context.put("fromJenkins", runWithJenkins);
     context.put("report_status_colour", ri.getTagReportStatusColour(tagObject));
     generateReport(
         tagObject.getTagName().replace("@", "").trim() + ".html", featureResult, context);
   }
 }
예제 #3
0
  public void generateFeatureReports() throws Exception {
    Iterator<Map.Entry<String, List<Feature>>> it = ri.getProjectFeatureMap().entrySet().iterator();
    while (it.hasNext()) {
      Map.Entry<String, List<Feature>> pairs = it.next();
      List<Feature> featureList = (List<Feature>) pairs.getValue();

      for (Feature feature : featureList) {
        VelocityEngine ve = new VelocityEngine();
        ve.init(getProperties());
        Template featureResult = ve.getTemplate("templates/featureReport.vm");
        VelocityContext context = new VelocityContext();
        context.put("feature", feature);
        context.put("report_status_colour", ri.getReportStatusColour(feature));
        context.put("build_project", buildProject);
        context.put("build_number", buildNumber);
        context.put("scenarios", feature.getElements());
        context.put("time_stamp", ri.timeStamp());
        context.put("jenkins_base", pluginUrlPath);
        context.put("fromJenkins", runWithJenkins);
        context.put("artifactsEnabled", ConfigurationOptions.artifactsEnabled());
        generateReport(feature.getFileName(), featureResult, context);
      }
    }
  }
예제 #4
0
 public boolean getBuildStatus() {
   return !(ri.getTotalNumberFailingSteps() > 0);
 }
예제 #5
0
  private void generateFeatureOverview() throws Exception {
    int numberTotalPassed = ri.getTotalNumberPassingSteps();
    int numberTotalFailed = ri.getTotalNumberFailingSteps();
    int numberTotalSkipped = ri.getTotalNumberSkippedSteps();
    int numberTotalPending = ri.getTotalNumberPendingSteps();

    VelocityEngine ve = new VelocityEngine();
    ve.init(getProperties());
    Template featureOverview = ve.getTemplate("templates/featureOverview.vm");
    VelocityContext context = new VelocityContext();
    context.put("build_project", buildProject);
    context.put("build_number", buildNumber);
    context.put("features", ri.getFeatures());
    context.put("total_features", ri.getTotalNumberOfFeatures());
    context.put("total_scenarios", ri.getTotalNumberOfScenarios());
    context.put("total_steps", ri.getTotalNumberOfSteps());
    context.put("total_passes", numberTotalPassed);
    context.put("total_fails", numberTotalFailed);
    context.put("total_skipped", numberTotalSkipped);
    context.put("total_pending", numberTotalPending);
    if (flashCharts) {
      context.put(
          "step_data",
          FlashChartBuilder.donutChart(
              numberTotalPassed, numberTotalFailed, numberTotalSkipped, numberTotalPending));
      context.put(
          "scenario_data",
          FlashChartBuilder.pieChart(ri.getTotalScenariosPassed(), ri.getTotalScenariosFailed()));
    } else {
      JsChartUtil pie = new JsChartUtil();
      List<String> stepColours =
          pie.orderStepsByValue(
              numberTotalPassed, numberTotalFailed, numberTotalSkipped, numberTotalPending);
      context.put("step_data", stepColours);
      context.put("scenarios_passed", ri.getTotalScenariosPassed());
      context.put("scenarios_failed", ri.getTotalScenariosFailed());
      List<String> scenarioColours =
          pie.orderScenariosByValue(ri.getTotalScenariosPassed(), ri.getTotalScenariosFailed());
      context.put("scenario_data", scenarioColours);
    }
    context.put("time_stamp", ri.timeStamp());
    context.put("total_duration", ri.getTotalDurationAsString());
    context.put("jenkins_base", pluginUrlPath);
    context.put("fromJenkins", runWithJenkins);
    context.put("flashCharts", flashCharts);
    generateReport("feature-overview.html", featureOverview, context);
  }