Package org.junit.internal.matchers
Class StacktracePrintingMatcher<T extends Throwable>
java.lang.Object
org.hamcrest.BaseMatcher<T>
org.hamcrest.TypeSafeMatcher<T>
org.junit.internal.matchers.StacktracePrintingMatcher<T>
- All Implemented Interfaces:
org.hamcrest.Matcher<T>
,org.hamcrest.SelfDescribing
A matcher that delegates to throwableMatcher and in addition appends the
stacktrace of the actual Throwable in case of a mismatch.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
describeMismatchSafely
(T item, org.hamcrest.Description description) void
describeTo
(org.hamcrest.Description description) static <T extends Exception>
org.hamcrest.Matcher<T> isException
(org.hamcrest.Matcher<T> exceptionMatcher) static <T extends Throwable>
org.hamcrest.Matcher<T> isThrowable
(org.hamcrest.Matcher<T> throwableMatcher) protected boolean
matchesSafely
(T item) private String
readStacktrace
(Throwable throwable) Methods inherited from class org.hamcrest.TypeSafeMatcher
describeMismatch, matches
Methods inherited from class org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, isNotNull, toString
-
Field Details
-
throwableMatcher
-
-
Constructor Details
-
StacktracePrintingMatcher
-
-
Method Details
-
describeTo
public void describeTo(org.hamcrest.Description description) -
matchesSafely
-
describeMismatchSafely
-
readStacktrace
-
isThrowable
public static <T extends Throwable> org.hamcrest.Matcher<T> isThrowable(org.hamcrest.Matcher<T> throwableMatcher) -
isException
public static <T extends Exception> org.hamcrest.Matcher<T> isException(org.hamcrest.Matcher<T> exceptionMatcher)
-