Refine search
private void describeMismatch(Matcher<? super F> matcher, F item) { mismatchDescription.appendText("item " + nextMatchIx + ": "); matcher.describeMismatch(item, mismatchDescription); } }
@Override protected void describeMismatchSafely(T item, Description description) { description.appendText("cause "); causeMatcher.describeMismatch(item.getCause(), description); }
@Override protected void describeMismatchSafely(T item, Description description) { description.appendText("message "); matcher.describeMismatch(item.getMessage(), description); }
@Override public boolean matching(Matcher<T> matcher, String message) { if (matcher.matches(theValue)) { return true; } mismatch.appendText(message); matcher.describeMismatch(theValue, mismatch); return false; }
@Override protected void describeMismatchSafely(T item, Description description) { description.appendText("message "); fMatcher.describeMismatch(item.getMessage(), description); }
@Override protected void describeMismatchSafely(T item, Description description) { description.appendText("cause "); fMatcher.describeMismatch(item.getCause(), description); }
@Override public boolean matchesSafely(Iterable<T> collection, Description mismatchDescription) { for (T t : collection) { if (!matcher.matches(t)) { mismatchDescription.appendText("an item "); matcher.describeMismatch(t, mismatchDescription); return false; } } return true; }
@Override public boolean matches(Object actual, Description mismatch) { final Object actualValue = readProperty(readMethod, actual); if (!matcher.matches(actualValue)) { mismatch.appendText(propertyName + " "); matcher.describeMismatch(actualValue, mismatch); return false; } return true; }
@Override public boolean matching(Matcher<T> matcher, String message) { if (matcher.matches(theValue)) { return true; } mismatch.appendText(message); matcher.describeMismatch(theValue, mismatch); return false; }
@Override public boolean matchesSafely(Iterable<T> collection, Description mismatchDescription) { for (T t : collection) { if (!matcher.matches(t)) { mismatchDescription.appendText("an item "); matcher.describeMismatch(t, mismatchDescription); return false; } } return true; }
@Override public boolean matches(Object o, Description mismatch) { for (Matcher<? super T> matcher : matchers) { if (!matcher.matches(o)) { mismatch.appendDescriptionOf(matcher).appendText(" "); matcher.describeMismatch(o, mismatch); return false; } } return true; }
@Override public boolean matches(Object o, Description mismatch) { for (Matcher<? super T> matcher : matchers) { if (!matcher.matches(o)) { mismatch.appendDescriptionOf(matcher).appendText(" "); matcher.describeMismatch(o, mismatch); return false; } } return true; }
@Override protected boolean matchesSafely(Iterable<? super T> collection, Description mismatchDescription) { boolean isPastFirst = false; for (Object item : collection) { if (elementMatcher.matches(item)){ return true; } if (isPastFirst) { mismatchDescription.appendText(", "); } elementMatcher.describeMismatch(item, mismatchDescription); isPastFirst = true; } return false; }
@Override protected boolean matchesSafely(Iterable<? super T> collection, Description mismatchDescription) { boolean isPastFirst = false; for (Object item : collection) { if (elementMatcher.matches(item)){ return true; } if (isPastFirst) { mismatchDescription.appendText(", "); } elementMatcher.describeMismatch(item, mismatchDescription); isPastFirst = true; } return false; }
@Override public boolean matchesSafely(Iterable<? extends T> collection, Description mismatchDescription) { for (T t : collection) { if (!matcher.matches(t)) { mismatchDescription.appendText("an item "); matcher.describeMismatch(t, mismatchDescription); return false; } } return true; }
@Override public boolean matching(Matcher<T> matcher, String message) { if (matcher.matches(theValue)) { return true; } mismatch.appendText(message); matcher.describeMismatch(theValue, mismatch); return false; }
@Override public boolean matches(Object actual, Description mismatch) { final Object actualValue = readProperty(readMethod, actual); if (!matcher.matches(actualValue)) { mismatch.appendText(propertyName + " "); matcher.describeMismatch(actualValue, mismatch); return false; } return true; }
@Override protected void describeMismatchSafely(T item, Description description) { throwableMatcher.describeMismatch(item, description); description.appendText("\nStacktrace was: "); description.appendText(readStacktrace(item)); }
@Override protected boolean matchesSafely(T bean, Description mismatchDescription) { V value = accessor.apply(bean); boolean valueMatches = matcher.matches(value); if (!valueMatches) { mismatchDescription.appendText("value \"" + path.toString() + "\" "); matcher.describeMismatch(value, mismatchDescription); } return valueMatches; }
@Override public boolean matches(Object o, Description mismatch) { for (Matcher<? super T> matcher : matchers) { if (!matcher.matches(o)) { mismatch.appendDescriptionOf(matcher).appendText(" "); matcher.describeMismatch(o, mismatch); return false; } } return true; }