if(getResult()==Result.ABORTED)
return new Summary(false, Messages.Run_Summary_Aborted());
if(getResult()==Result.UNSTABLE) {
if(((Run)this) instanceof AbstractBuild) {
AbstractTestResultAction trN = ((AbstractBuild)(Run)this).getTestResultAction();
AbstractTestResultAction trP = prev==null ? null : ((AbstractBuild) prev).getTestResultAction();
if(trP==null) {
if(trN!=null && trN.getFailCount()>0)
return new Summary(false, Messages.Run_Summary_TestFailures(trN.getFailCount()));
else // ???
return new Summary(false, Messages.Run_Summary_Unstable());
}
if(trP.getFailCount()==0)
return new Summary(true, Messages.Run_Summary_TestsStartedToFail(trN.getFailCount()));
if(trP.getFailCount() < trN.getFailCount())
return new Summary(true, Messages.Run_Summary_MoreTestsFailing(trN.getFailCount()-trP.getFailCount(), trN.getFailCount()));
if(trP.getFailCount() > trN.getFailCount())
return new Summary(false, Messages.Run_Summary_LessTestsFailing(trP.getFailCount()-trN.getFailCount(), trN.getFailCount()));
return new Summary(false, Messages.Run_Summary_TestsStillFailing(trN.getFailCount()));
}
}