예제 #1
0
 /**
  * Gets the counter part of this {@link TestResult} in the specified run.
  *
  * @return null if no such counter part exists.
  */
 public TestResult getResultInBuild(AbstractBuild<?, ?> build) {
   AbstractTestResultAction tra = build.getAction(getParentAction().getClass());
   if (tra == null) {
     tra = build.getAction(AbstractTestResultAction.class);
   }
   return (tra == null) ? null : tra.findCorrespondingResult(this.getId());
 }
예제 #2
0
 /**
  * Gets the counter part of this {@link TestResult} in the previous run.
  *
  * @return null if no such counter part exists.
  */
 public TestResult getPreviousResult() {
   AbstractBuild<?, ?> b = getOwner();
   if (b == null) {
     return null;
   }
   while (true) {
     b = b.getPreviousBuild();
     if (b == null) return null;
     AbstractTestResultAction r = b.getAction(getParentAction().getClass());
     if (r != null) {
       TestResult result = r.findCorrespondingResult(this.getId());
       if (result != null) return result;
     }
   }
 }