diff options
author | Paul Duffin <paulduffin@google.com> | 2016-12-14 12:42:07 +0000 |
---|---|---|
committer | Paul Duffin <paulduffin@google.com> | 2016-12-20 15:52:52 +0000 |
commit | 86f323b2a73c9c250fbe25b828435aa936704ab3 (patch) | |
tree | 5e35bd76d6575654fdba8c7d6d64c11e55327755 /src/main/java/org/junit/internal/matchers/ThrowableMessageMatcher.java | |
parent | 4156f43b51c6f2d42df6e45535e1967aa46514d3 (diff) | |
download | junit-86f323b2a73c9c250fbe25b828435aa936704ab3.tar.gz |
Revert matchers back to 4.10 to compile against Hamcrest 1.1
JUnit 4.12 is supposed to be built against Hamcrest 1.3 or above
but external/hamcrest is still at 1.1. This reverts affected
files back to their 4.10 version so that they will compile
against Hamcrest 1.1 for now.
Bug: 33613916
Test: make checkbuild
Change-Id: Ie3c15047aa5a942ed0987c31c345725bef4db3d4
Diffstat (limited to 'src/main/java/org/junit/internal/matchers/ThrowableMessageMatcher.java')
-rw-r--r-- | src/main/java/org/junit/internal/matchers/ThrowableMessageMatcher.java | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/src/main/java/org/junit/internal/matchers/ThrowableMessageMatcher.java b/src/main/java/org/junit/internal/matchers/ThrowableMessageMatcher.java deleted file mode 100644 index 74386a8..0000000 --- a/src/main/java/org/junit/internal/matchers/ThrowableMessageMatcher.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.junit.internal.matchers; - -import org.hamcrest.Description; -import org.hamcrest.Factory; -import org.hamcrest.Matcher; -import org.hamcrest.TypeSafeMatcher; - -public class ThrowableMessageMatcher<T extends Throwable> extends - TypeSafeMatcher<T> { - - private final Matcher<String> matcher; - - public ThrowableMessageMatcher(Matcher<String> matcher) { - this.matcher = matcher; - } - - public void describeTo(Description description) { - description.appendText("exception with message "); - description.appendDescriptionOf(matcher); - } - - @Override - protected boolean matchesSafely(T item) { - return matcher.matches(item.getMessage()); - } - - @Override - protected void describeMismatchSafely(T item, Description description) { - description.appendText("message "); - matcher.describeMismatch(item.getMessage(), description); - } - - @Factory - public static <T extends Throwable> Matcher<T> hasMessage(final Matcher<String> matcher) { - return new ThrowableMessageMatcher<T>(matcher); - } -}
\ No newline at end of file |