public final class Fail extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
Fail()
This constructor is protected to make it possible to subclass this class.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
fail(String failureMessage)
Fails with the given message.
|
static void |
fail(String failureMessage,
Throwable realCause)
Throws an
AssertionError with the given message and with the Throwable that caused the failure. |
static void |
failBecauseExceptionWasNotThrown(Class<? extends Throwable> throwableClass)
Throws an
AssertionError with a message explaining that a Throwable of given class was expected to be thrown
but had not been. |
static void |
setRemoveFestRelatedElementsFromStackTrace(boolean removeFestRelatedElementsFromStackTrace)
Sets wether we remove elements related to Fest from assertion error stack trace.
|
protected Fail()
public static void setRemoveFestRelatedElementsFromStackTrace(boolean removeFestRelatedElementsFromStackTrace)
removeFestRelatedElementsFromStackTrace - flag.public static void fail(String failureMessage)
failureMessage - error message.AssertionError - with the given message.public static void fail(String failureMessage, Throwable realCause)
AssertionError with the given message and with the Throwable that caused the failure.failureMessage - the description of the failed assertion. It can be null.realCause - cause of the error.AssertionError - with the given message and with the Throwable that caused the failure.public static void failBecauseExceptionWasNotThrown(Class<? extends Throwable> throwableClass)
AssertionError with a message explaining that a Throwable of given class was expected to be thrown
but had not been.throwableClass - the Throwable class that was expected to be thrown.AssertionError - with a message explaining that a Throwable of given class was expected to be thrown but had
not been.Copyright © 2013 AssertJ. All Rights Reserved.