Package org.junit.experimental.results
Class ResultMatchers
java.lang.Object
org.junit.experimental.results.ResultMatchers
Matchers on a PrintableResult, to enable JUnit self-tests.
For example:
assertThat(testResult(HasExpectedException.class), isSuccessful());
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.hamcrest.Matcher<PrintableResult>
failureCountIs
(int count) Matches if there arecount
failuresstatic org.hamcrest.Matcher<PrintableResult>
hasFailureContaining
(String string) Matches if the result has one or more failures, and at least one of them containsstring
static org.hamcrest.Matcher<Object>
hasSingleFailureContaining
(String string) Matches if the result has exactly one failure, and it containsstring
static org.hamcrest.Matcher<PrintableResult>
hasSingleFailureMatching
(org.hamcrest.Matcher<Throwable> matcher) Matches if the result has exactly one failure matching the given matcher.static org.hamcrest.Matcher<PrintableResult>
Matches if the tests are all successful
-
Constructor Details
-
ResultMatchers
Deprecated.will be private soon.Do not instantiate.
-
-
Method Details
-
isSuccessful
Matches if the tests are all successful -
failureCountIs
Matches if there arecount
failures -
hasSingleFailureContaining
Matches if the result has exactly one failure, and it containsstring
-
hasSingleFailureMatching
public static org.hamcrest.Matcher<PrintableResult> hasSingleFailureMatching(org.hamcrest.Matcher<Throwable> matcher) Matches if the result has exactly one failure matching the given matcher.- Since:
- 4.13
-
hasFailureContaining
Matches if the result has one or more failures, and at least one of them containsstring
-