T - the type of value being matchedpublic class RecordingMatcher<T>
extends org.hamcrest.BaseMatcher<T>
Matcher that can be used to record the success and failures of another Matcher.
Typically this class is used for testing interaction with other Matchers.
Copyright (c) 2016. All Rights Reserved. Oracle Corporation.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
| Constructor and Description |
|---|
RecordingMatcher(org.hamcrest.Matcher<? super T> matcher)
Constructs a
RecordingMatcher. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
attempted()
Determines if a match has been attempted with the
Matcher. |
void |
describeTo(org.hamcrest.Description description) |
int |
getAttemptCount()
Obtains the number of match attempts.
|
int |
getFailureCount()
Obtains the current number of failed matches.
|
int |
getSuccessCount()
Obtain the current number of successful matches.
|
boolean |
hasFailed()
Determines if one or more failures to match the
Matcher has occurred. |
boolean |
hasSucceeded()
Determines if one or more successful matches with the
Matcher has occurred. |
boolean |
matches(Object o) |
static <T> RecordingMatcher<T> |
of(org.hamcrest.Matcher<? super T> matcher)
Obtains a
RecordingMatcher for a specified Matcher. |
public RecordingMatcher(org.hamcrest.Matcher<? super T> matcher)
RecordingMatcher.matcher - the Matcher being recordedpublic static <T> RecordingMatcher<T> of(org.hamcrest.Matcher<? super T> matcher)
RecordingMatcher for a specified Matcher.T - the type of values being matchedmatcher - the MatcherRecordingMatcherpublic int getSuccessCount()
public boolean hasSucceeded()
Matcher has occurred.true when one or more successful matches has occurred
false otherwisepublic int getFailureCount()
public boolean hasFailed()
Matcher has occurred.true when one or more failures have occurred
false otherwisepublic int getAttemptCount()
public boolean attempted()
Matcher.true when a match has been attempted,
false otherwisepublic boolean matches(Object o)
public void describeTo(org.hamcrest.Description description)
Copyright © 2017. All rights reserved.