/** * Returns the last successful build, if any. Otherwise null. A successful build would include * either {@link Result#SUCCESS} or {@link Result#UNSTABLE}. * * @see #getLastStableBuild() */ @Exported @QuickSilver public RunT getLastSuccessfulBuild() { RunT r = getLastBuild(); // temporary hack till we figure out what's causing this bug while (r != null && (r.isBuilding() || r.getResult() == null || r.getResult().isWorseThan(Result.UNSTABLE))) r = r.getPreviousBuild(); return r; }
/** * Returns the last 'numberOfBuilds' builds with a build result >= 'threshold' * * @return a list with the builds. May be smaller than 'numberOfBuilds' or even empty if not * enough builds satisfying the threshold have been found. Never null. */ public List<RunT> getLastBuildsOverThreshold(int numberOfBuilds, Result threshold) { List<RunT> result = new ArrayList<RunT>(numberOfBuilds); RunT r = getLastBuild(); while (r != null && result.size() < numberOfBuilds) { if (!r.isBuilding() && (r.getResult() != null && r.getResult().isBetterOrEqualTo(threshold))) { result.add(r); } r = r.getPreviousBuild(); } return result; }
/** Returns the last failed build, if any. Otherwise null. */ @Exported @QuickSilver public RunT getLastFailedBuild() { RunT r = getLastBuild(); while (r != null && (r.isBuilding() || r.getResult() != Result.FAILURE)) r = r.getPreviousBuild(); return r; }
/** * Returns the last stable build, if any. Otherwise null. * * @see #getLastSuccessfulBuild */ @Exported @QuickSilver public RunT getLastStableBuild() { RunT r = getLastBuild(); while (r != null && (r.isBuilding() || r.getResult().isWorseThan(Result.SUCCESS))) r = r.getPreviousBuild(); return r; }
/** * Returns the last unstable build, if any. Otherwise null. * * @see #getLastSuccessfulBuild */ @Exported @QuickSilver public RunT getLastUnstableBuild() { RunT r = getLastBuild(); while (r != null && (r.isBuilding() || r.getResult() != Result.UNSTABLE)) r = r.getPreviousBuild(); return r; }
/** * Returns the last build that was anything but stable, if any. Otherwise null. * * @see #getLastSuccessfulBuild */ @Exported @QuickSilver public RunT getLastUnsuccessfulBuild() { RunT r = getLastBuild(); while (r != null && (r.isBuilding() || r.getResult() == Result.SUCCESS)) r = r.getPreviousBuild(); return r; }