|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fest.assertions.api.Fail
public final class Fail
Common failures.
Constructor Summary | |
---|---|
protected |
Fail()
This constructor is protected to make it possible to subclass this class. |
Method Summary | |
---|---|
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 Exception> exceptionClass)
Throws an AssertionError with a message explaining that an expection of given exceptionClass type 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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Fail()
Method Detail |
---|
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 Exception> exceptionClass)
AssertionError
with a message explaining that an expection of given exceptionClass type was expected to be thrown but had not been.
exceptionClass
- the class exception that was expected to be thrown.
AssertionError
- with a message explaining that an expection of given exceptionClass type was expected to be thrown but had not been.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |