hudson.plugins.PerfPublisher.Report.Report Maven / Gradle / Ivy
package hudson.plugins.PerfPublisher.Report;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
/**
* Model class representing one PerfPublisher Rapport.
*
* @author Georges Bossert
*/
public class Report {
private String categorie;
private String name;
private String startDate;
private String startDateFormat;
private String startTime;
private String startTimeFormat;
private String endDate;
private String endDateFormat;
private String endTime;
private String endTimeFormat;
private String file;
private ArrayList tests;
private ArrayList executedTests;
public Report() {
tests = new ArrayList();
executedTests = new ArrayList();
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the startDate
*/
public String getStartDate() {
return startDate;
}
public String getEndDate() {
return endDate;
}
public void setEndDate(String endDate) {
this.endDate = endDate;
}
public String getEndDateFormat() {
return endDateFormat;
}
public void setEndDateFormat(String endDateFormat) {
this.endDateFormat = endDateFormat;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public String getEndTimeFormat() {
return endTimeFormat;
}
public void setEndTimeFormat(String endTimeFormat) {
this.endTimeFormat = endTimeFormat;
}
/**
* @param startDate the startDate to set
*/
public void setStartDate(String startDate) {
this.startDate = startDate;
}
/**
* @return the startTime
*/
public String getStartTime() {
return startTime;
}
/**
* @param startTime the startTime to set
*/
public void setStartTime(String startTime) {
this.startTime = startTime;
}
/**
* @return the tests
*/
public ArrayList getTests() {
return tests;
}
/**
* @param tests the tests to set
*/
public void setTests(ArrayList tests) {
for (int i=0; i containing all the executed test
*/
public ArrayList getExecutedTests() {
if (this.executedTests==null || this.executedTests.size()==0) {
//Verify there is no executed test
//Support backward compatibility
this.executedTests = new ArrayList();
for (int i=0; i getNotExecutedTests() {
ArrayList result = new ArrayList();
for (int i=0; i getTestsWithCompileTime() {
ArrayList result = new ArrayList();
for (int i=0; i getTestsWithCompileTime().get(i).getCompileTime().getMeasure()) {
result = getTestsWithCompileTime().get(i).getCompileTime().getMeasure();
test = getTestsWithCompileTime().get(i);
}
}
return test;
}
public CompileTime getBestCompileTime() {
return getBestCompileTimeTest().getCompileTime();
}
/**
* @return name of the value having the lower compile time value
*/
public double getBestCompileTimeTestValue() {
return getBestCompileTimeTest().getCompileTime().getMeasure();
}
/**
* @return name of the test having the lower compile time value
*/
public String getBestCompileTimeTestName() {
return getBestCompileTimeTest().getName();
}
/**
* @return name of the test having the highest compile time value
*/
public String getWorstCompileTimeTestName() {
String result = "";
double temp = 0.0;
for (int i=0; i getTestsWithExecutionTime() {
ArrayList result = new ArrayList();
for (int i=0; i getTestsWithExecutionTime().get(i).getExecutionTime().getMeasure()) {
temp = getTestsWithExecutionTime().get(i).getExecutionTime().getMeasure();
result = getTestsWithExecutionTime().get(i).getName();
}
}
return result;
}
/**
* @return name of the value having the lowest execution time value
*/
public double getBestExecutionTimeTestValue() {
double result = 0.0;
for (int i=0; i getTestsWithExecutionTime().get(i).getExecutionTime().getMeasure()) {
result = getTestsWithExecutionTime().get(i).getExecutionTime().getMeasure();
}
}
return result;
}
/**
* @return inferior standard deviation of the execution time average
*/
public double getInfStandardDeviationOfExecutionTimeAverage() {
double result = 0.0f;
for (int i=0; i getTestsWithPerformance() {
ArrayList result = new ArrayList();
for (int i=0; i getTestsWithSuccess() {
ArrayList result = new ArrayList();
for (int i=0; i getTestsWithPerformance().get(i).getPerformance().getMeasure()) {
temp = getTestsWithPerformance().get(i).getPerformance().getMeasure();
result = getTestsWithPerformance().get(i).getName();
}
}
return result;
}
/**
* @return name of the value having the lowest execution time value
*/
public double getWorstPerformanceTestValue() {
double result = 0.0;
for (int i=0; i getTestsWithPerformance().get(i).getPerformance().getMeasure()) {
result = getTestsWithPerformance().get(i).getPerformance().getMeasure();
}
}
return result;
}
/**
* @return inferior standard deviation of the Performance average
*/
public double getInfStandardDeviationOfPerformanceAverage() {
double result = 0.0f;
for (int i=0; i