All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hudson.plugins.PerfPublisher.ChangedStatusTestsDetails Maven / Gradle / Ivy

Go to download

The PerfPublisher plug-in scans for xml tests reports defined in the administration panel and generates trend graphs, computes stats and underline regressions and modifications. The xml files must be generated by your own testing tool.

There is a newer version: 7.97
Show newest version
package hudson.plugins.PerfPublisher;

import java.awt.Color;
import java.io.IOException;
import java.util.List;

import org.jfree.chart.ChartFactory;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.CategoryAxis;
import org.jfree.chart.axis.CategoryLabelPositions;
import org.jfree.chart.axis.NumberAxis;
import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.renderer.category.CategoryItemRenderer;
import org.jfree.ui.RectangleInsets;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;

import hudson.model.ModelObject;
import hudson.model.AbstractBuild;
import hudson.model.Result;
import hudson.plugins.PerfPublisher.Report.Report;
import hudson.plugins.PerfPublisher.Report.ReportContainer;
import hudson.plugins.PerfPublisher.Report.Test;
import hudson.util.ChartUtil;
import hudson.util.ColorPalette;
import hudson.util.DataSetBuilder;
import hudson.util.ShiftedCategoryAxis;
import hudson.util.ChartUtil.NumberOnlyBuildLabel;

public class ChangedStatusTestsDetails implements ModelObject {

	private final TrendReport report;
	private final AbstractBuild _owner;

	public ChangedStatusTestsDetails(final AbstractBuild owner, TrendReport rep) {
		report = rep;
		this._owner = owner;
	}

	public AbstractBuild getOwner() {
		return _owner;
	}

	public String getDisplayName() {
		return "Details of status changed tests.";
	}

	public TrendReport getReport() {
		return report;
	}
	
	public String getPageContent() {
		StringBuilder stb = new StringBuilder();
		List tests = report.getExecutionStatusChangedTests();
		if (tests.size()>0) {
		
			stb.append("");
	    	stb.append("");
	 		stb.append("");
	 		stb.append("");
	 		stb.append("");
	 		
	 		
	 		for (int i=0; i");
	 			if (t.isExecuted()){
	 				stb.append("");
	 			}else {
	 				stb.append("");
	 			}
	 			stb.append("");
	 		}
	     		
	 		                
	 		stb.append("
TestsExecution status modification
"+t.getName()+"Not executed ExecutedExecuted Not executed
"); } else { stb.append("None of the tests has changed of execution status.
"); } tests = report.getSuccessStatusChangedTests(); if (tests.size()>0) { stb.append(""); stb.append(""); stb.append(""); stb.append(""); stb.append(""); for (int i=0; i"); if (t.isSuccessfull()){ stb.append(""); }else { stb.append(""); } stb.append(""); } stb.append("
TestsSuccess status modification
"+t.getName()+"Failed SuccessfullSuccessfull Failed
"); } else { stb.append("None of the tests has changed of success status.
"); } return stb.toString(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy