diff options
Diffstat (limited to 'src/main/java/org/junit/internal/runners/model/EachTestNotifier.java')
-rw-r--r-- | src/main/java/org/junit/internal/runners/model/EachTestNotifier.java | 79 |
1 files changed, 38 insertions, 41 deletions
diff --git a/src/main/java/org/junit/internal/runners/model/EachTestNotifier.java b/src/main/java/org/junit/internal/runners/model/EachTestNotifier.java index a7d534c..e094809 100644 --- a/src/main/java/org/junit/internal/runners/model/EachTestNotifier.java +++ b/src/main/java/org/junit/internal/runners/model/EachTestNotifier.java @@ -1,6 +1,3 @@ -/** - * - */ package org.junit.internal.runners.model; import org.junit.internal.AssumptionViolatedException; @@ -10,42 +7,42 @@ import org.junit.runner.notification.RunNotifier; import org.junit.runners.model.MultipleFailureException; public class EachTestNotifier { - private final RunNotifier fNotifier; - - private final Description fDescription; - - public EachTestNotifier(RunNotifier notifier, Description description) { - fNotifier= notifier; - fDescription= description; - } - - public void addFailure(Throwable targetException) { - if (targetException instanceof MultipleFailureException) { - addMultipleFailureException((MultipleFailureException) targetException); - } else { - fNotifier - .fireTestFailure(new Failure(fDescription, targetException)); - } - } - - private void addMultipleFailureException(MultipleFailureException mfe) { - for (Throwable each : mfe.getFailures()) - addFailure(each); - } - - public void addFailedAssumption(AssumptionViolatedException e) { - fNotifier.fireTestAssumptionFailed(new Failure(fDescription, e)); - } - - public void fireTestFinished() { - fNotifier.fireTestFinished(fDescription); - } - - public void fireTestStarted() { - fNotifier.fireTestStarted(fDescription); - } - - public void fireTestIgnored() { - fNotifier.fireTestIgnored(fDescription); - } + private final RunNotifier notifier; + + private final Description description; + + public EachTestNotifier(RunNotifier notifier, Description description) { + this.notifier = notifier; + this.description = description; + } + + public void addFailure(Throwable targetException) { + if (targetException instanceof MultipleFailureException) { + addMultipleFailureException((MultipleFailureException) targetException); + } else { + notifier.fireTestFailure(new Failure(description, targetException)); + } + } + + private void addMultipleFailureException(MultipleFailureException mfe) { + for (Throwable each : mfe.getFailures()) { + addFailure(each); + } + } + + public void addFailedAssumption(AssumptionViolatedException e) { + notifier.fireTestAssumptionFailed(new Failure(description, e)); + } + + public void fireTestFinished() { + notifier.fireTestFinished(description); + } + + public void fireTestStarted() { + notifier.fireTestStarted(description); + } + + public void fireTestIgnored() { + notifier.fireTestIgnored(description); + } }
\ No newline at end of file |