use of hudson.tasks.test.TestResult in project hudson-2.x by hudson.
the class History method getDurationGraph.
/**
* Graph of duration of tests over time.
*/
public Graph getDurationGraph() {
return new GraphImpl("seconds") {
protected DataSetBuilder<String, ChartLabel> createDataSet() {
DataSetBuilder<String, ChartLabel> data = new DataSetBuilder<String, ChartLabel>();
List<TestResult> list;
try {
list = getList(Integer.parseInt(Stapler.getCurrentRequest().getParameter("start")), Integer.parseInt(Stapler.getCurrentRequest().getParameter("end")));
} catch (NumberFormatException e) {
list = getList();
}
for (hudson.tasks.test.TestResult o : list) {
data.add(((double) o.getDuration()) / (1000), "", new ChartLabel(o) {
@Override
public Color getColor() {
if (o.getFailCount() > 0)
return ColorPalette.RED;
else if (o.getSkipCount() > 0)
return ColorPalette.YELLOW;
else
return ColorPalette.BLUE;
}
});
}
return data;
}
};
}
use of hudson.tasks.test.TestResult in project hudson-2.x by hudson.
the class History method getCountGraph.
/**
* Graph of # of tests over time.
*/
public Graph getCountGraph() {
return new GraphImpl("") {
protected DataSetBuilder<String, ChartLabel> createDataSet() {
DataSetBuilder<String, ChartLabel> data = new DataSetBuilder<String, ChartLabel>();
List<TestResult> list;
try {
list = getList(Integer.parseInt(Stapler.getCurrentRequest().getParameter("start")), Integer.parseInt(Stapler.getCurrentRequest().getParameter("end")));
} catch (NumberFormatException e) {
list = getList();
}
for (TestResult o : list) {
data.add(o.getPassCount(), "2Passed", new ChartLabel(o));
data.add(o.getFailCount(), "1Failed", new ChartLabel(o));
data.add(o.getSkipCount(), "0Skipped", new ChartLabel(o));
}
return data;
}
};
}
use of hudson.tasks.test.TestResult in project hudson-2.x by hudson.
the class History method getList.
public List<TestResult> getList(int start, int end) {
List<TestResult> list = new ArrayList<TestResult>();
end = Math.min(end, testObject.getOwner().getParent().getBuilds().size());
for (AbstractBuild<?, ?> b : testObject.getOwner().getParent().getBuilds().subList(start, end)) {
if (b.isBuilding())
continue;
TestResult o = testObject.getResultInBuild(b);
if (o != null) {
list.add(o);
}
}
return list;
}
Aggregations