|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fest.assertions.api.AbstractAssert<ThrowableAssert,Throwable>
org.fest.assertions.api.ThrowableAssert
public class ThrowableAssert
Assertion methods for
s.
Throwable
To create a new instance of this class, invoke
.
Assertions.assertThat(Throwable)
Field Summary |
---|
Fields inherited from class org.fest.assertions.api.AbstractAssert |
---|
actual, myself |
Constructor Summary | |
---|---|
protected |
ThrowableAssert(Throwable actual)
|
Method Summary | |
---|---|
ThrowableAssert |
hasMessage(String message)
Verifies that the message of the actual Throwable is equal to the given one. |
ThrowableAssert |
hasMessageContaining(String description)
Verifies that the message of the actual Throwable contains with the given description. |
ThrowableAssert |
hasMessageEndingWith(String description)
Verifies that the message of the actual Throwable ends with the given description. |
ThrowableAssert |
hasMessageStartingWith(String description)
Verifies that the message of the actual Throwable starts with the given description. |
ThrowableAssert |
hasNoCause()
Verifies that the actual Throwable does not have a cause. |
ThrowableAssert |
isExactlyInstanceOf(Class<? extends Throwable> type)
Verifies that the actual Throwable is an instance of the given type. |
ThrowableAssert |
isInstanceOf(Class<? extends Throwable> type)
Verifies that the actual Throwable is an instance of the given type. |
Methods inherited from class org.fest.assertions.api.AbstractAssert |
---|
as, as, describedAs, describedAs, descriptionText, doesNotHave, equals, has, hashCode, is, isEqualTo, isIn, isIn, isNot, isNotEqualTo, isNotIn, isNotIn, isNotNull, isNotSameAs, isNull, isSameAs, usingComparator, usingDefaultComparator |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ThrowableAssert(Throwable actual)
Method Detail |
---|
public ThrowableAssert isInstanceOf(Class<? extends Throwable> type)
Throwable
is an instance of the given type.
type
- the type to check the actual Throwable
against.
AssertionError
- if the actual Throwable
is null
.
AssertionError
- if the actual Throwable
is not an instance of the given type.
NullPointerException
- if the given type is null
.public ThrowableAssert isExactlyInstanceOf(Class<? extends Throwable> type)
Throwable
is an instance of the given type. In order for the assertion to
pass, the type of the actual Throwable
has to be exactly the same as the given type.
type
- the type to check the actual Throwable
against.
AssertionError
- if the actual Throwable
is null
.
AssertionError
- if the actual Throwable
is not an instance of the given type.
NullPointerException
- if the given type is null
.public ThrowableAssert hasMessage(String message)
Throwable
is equal to the given one.
message
- the expected message.
AssertionError
- if the actual Throwable
is null
.
AssertionError
- if the message of the actual Throwable
is not equal to the given one.public ThrowableAssert hasNoCause()
Throwable
does not have a cause.
AssertionError
- if the actual Throwable
is null
.
AssertionError
- if the actual Throwable
has a cause.public ThrowableAssert hasMessageStartingWith(String description)
Throwable
starts with the given description.
description
- the description expected to start the actual Throwable
's message.
AssertionError
- if the actual Throwable
is null
.
AssertionError
- if the message of the actual Throwable
does not start with the given description.public ThrowableAssert hasMessageContaining(String description)
Throwable
contains with the given description.
description
- the description expected to be contained in the actual Throwable
's message.
AssertionError
- if the actual Throwable
is null
.
AssertionError
- if the message of the actual Throwable
does not contain the given description.public ThrowableAssert hasMessageEndingWith(String description)
Throwable
ends with the given description.
description
- the description expected to end the actual Throwable
's message.
AssertionError
- if the actual Throwable
is null
.
AssertionError
- if the message of the actual Throwable
does not end with the given description.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |