* @param worseOverride override the 'worse' parameter to this value.
* May be null in which case 'worse' is calculated based on the number of failed tests.
*/
private Summary determineDetailedUnstableSummary(Boolean worseOverride) {
if(((Run)this) instanceof AbstractBuild) {
AbstractTestResultAction trN = ((AbstractBuild)(Run)this).getTestResultAction();
Run prev = getPreviousBuild();
AbstractTestResultAction trP = prev==null ? null : ((AbstractBuild) prev).getTestResultAction();
if(trP==null) {
if(trN!=null && trN.getFailCount()>0)
return new Summary(worseOverride != null ? worseOverride : true,
Messages.Run_Summary_TestFailures(trN.getFailCount()));
} else {
if(trN.getFailCount()!= 0) {
if(trP.getFailCount()==0)
return new Summary(worseOverride != null ? worseOverride : true,
Messages.Run_Summary_TestsStartedToFail(trN.getFailCount()));
if(trP.getFailCount() < trN.getFailCount())
return new Summary(worseOverride != null ? worseOverride : true,
Messages.Run_Summary_MoreTestsFailing(trN.getFailCount()-trP.getFailCount(), trN.getFailCount()));
if(trP.getFailCount() > trN.getFailCount())
return new Summary(worseOverride != null ? worseOverride : false,
Messages.Run_Summary_LessTestsFailing(trP.getFailCount()-trN.getFailCount(), trN.getFailCount()));
return new Summary(worseOverride != null ? worseOverride : false,
Messages.Run_Summary_TestsStillFailing(trN.getFailCount()));
}
}