Open Source Repository

Home /junit/junit-4.8.2 | Repository Home



org/junit/internal/runners/model/MultipleFailureException.java
package org.junit.internal.runners.model;

import java.util.List;

public class MultipleFailureException extends Exception {
  private static final long serialVersionUID= 1L;
  
  private final List<Throwable> fErrors;

  public MultipleFailureException(List<Throwable> errors) {
    fErrors= errors;
  }

  public List<Throwable> getFailures() {
    return fErrors;
  }

  public static void assertEmpty(List<Throwable> errorsthrows Throwable {
    if (errors.isEmpty())
      return;
    if (errors.size() == 1)
      throw errors.get(0);
    throw new MultipleFailureException(errors);
  }
}