Package org.fest.assertions.internal
Class Throwables
- java.lang.Object
-
- org.fest.assertions.internal.Throwables
-
public class Throwables extends java.lang.ObjectReusable assertions fors.Throwable- Author:
- Joel Costigliola
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassertHasMessage(AssertionInfo info, java.lang.Throwable actual, java.lang.String message)Asserts that the given actualThrowablemessage is equal to the given one.voidassertHasMessageContaining(AssertionInfo info, java.lang.Throwable actual, java.lang.String description)Asserts that the message of the actualThrowablecontains with the given description.voidassertHasMessageEndingWith(AssertionInfo info, java.lang.Throwable actual, java.lang.String description)Asserts that the message of the actualThrowableends with the given description.voidassertHasMessageStartingWith(AssertionInfo info, java.lang.Throwable actual, java.lang.String description)Asserts that the message of the actualThrowablestarts with the given description.voidassertHasNoCause(AssertionInfo info, java.lang.Throwable actual)Asserts that the actualThrowabledoes not have a cause.static Throwablesinstance()Returns the singleton instance of this class.
-
-
-
Method Detail
-
instance
public static Throwables instance()
Returns the singleton instance of this class.- Returns:
- the singleton instance of this class.
-
assertHasMessage
public void assertHasMessage(AssertionInfo info, java.lang.Throwable actual, java.lang.String message)
Asserts that the given actualThrowablemessage is equal to the given one.- Parameters:
info- contains information about the assertion.actual- the givenThrowable.message- the expected message.- Throws:
java.lang.AssertionError- if the actualThrowableisnull.java.lang.AssertionError- if the message of the actualThrowableis not equal to the given one.
-
assertHasNoCause
public void assertHasNoCause(AssertionInfo info, java.lang.Throwable actual)
Asserts that the actualThrowabledoes not have a cause.- Parameters:
info- contains information about the assertion.actual- the givenThrowable.- Throws:
java.lang.AssertionError- if the actualThrowableisnull.java.lang.AssertionError- if the actualThrowablehas a cause.
-
assertHasMessageStartingWith
public void assertHasMessageStartingWith(AssertionInfo info, java.lang.Throwable actual, java.lang.String description)
Asserts that the message of the actualThrowablestarts with the given description.- Parameters:
info- contains information about the assertion.actual- the givenThrowable.description- the description expected to start the actualThrowable's message.- Throws:
java.lang.AssertionError- if the actualThrowableisnull.java.lang.AssertionError- if the message of the actualThrowabledoes not start with the given description.
-
assertHasMessageContaining
public void assertHasMessageContaining(AssertionInfo info, java.lang.Throwable actual, java.lang.String description)
Asserts that the message of the actualThrowablecontains with the given description.- Parameters:
info- contains information about the assertion.actual- the givenThrowable.description- the description expected to be contained in the actualThrowable's message.- Throws:
java.lang.AssertionError- if the actualThrowableisnull.java.lang.AssertionError- if the message of the actualThrowabledoes not contain the given description.
-
assertHasMessageEndingWith
public void assertHasMessageEndingWith(AssertionInfo info, java.lang.Throwable actual, java.lang.String description)
Asserts that the message of the actualThrowableends with the given description.- Parameters:
info- contains information about the assertion.actual- the givenThrowable.description- the description expected to end the actualThrowable's message.- Throws:
java.lang.AssertionError- if the actualThrowableisnull.java.lang.AssertionError- if the message of the actualThrowabledoes not end with the given description.
-
-