aboutsummaryrefslogtreecommitdiff
path: root/src/org/junit/runners/model/InitializationError.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/junit/runners/model/InitializationError.java')
-rw-r--r--src/org/junit/runners/model/InitializationError.java39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/org/junit/runners/model/InitializationError.java b/src/org/junit/runners/model/InitializationError.java
new file mode 100644
index 0000000..4de9ea7
--- /dev/null
+++ b/src/org/junit/runners/model/InitializationError.java
@@ -0,0 +1,39 @@
+package org.junit.runners.model;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Represents one or more problems encountered while initializing a Runner
+ */
+public class InitializationError extends Exception {
+ private static final long serialVersionUID= 1L;
+ private final List<Throwable> fErrors;
+
+ /**
+ * Construct a new {@code InitializationError} with one or more
+ * errors {@code errors} as causes
+ */
+ public InitializationError(List<Throwable> errors) {
+ fErrors= errors;
+ }
+
+ public InitializationError(Throwable error) {
+ this(Arrays.asList(error));
+ }
+
+ /**
+ * Construct a new {@code InitializationError} with one cause
+ * with message {@code string}
+ */
+ public InitializationError(String string) {
+ this(new Exception(string));
+ }
+
+ /**
+ * Returns one or more Throwables that led to this initialization error.
+ */
+ public List<Throwable> getCauses() {
+ return fErrors;
+ }
+}