1package org.junit.runners.model;
2
3import java.util.Arrays;
4import java.util.List;
5
6/**
7 * Represents one or more problems encountered while initializing a Runner
8 */
9public class InitializationError extends Exception {
10	private static final long serialVersionUID= 1L;
11	private final List<Throwable> fErrors;
12
13	/**
14	 * Construct a new {@code InitializationError} with one or more
15	 * errors {@code errors} as causes
16	 */
17	public InitializationError(List<Throwable> errors) {
18		fErrors= errors;
19	}
20
21	public InitializationError(Throwable error) {
22		this(Arrays.asList(error));
23	}
24
25	/**
26	 * Construct a new {@code InitializationError} with one cause
27	 * with message {@code string}
28	 */
29	public InitializationError(String string) {
30		this(new Exception(string));
31	}
32
33	/**
34	 * Returns one or more Throwables that led to this initialization error.
35	 */
36	public List<Throwable> getCauses() {
37		return fErrors;
38	}
39}
40