Class ResultMatchers

java.lang.Object
org.junit.experimental.results.ResultMatchers

public class ResultMatchers extends Object
Matchers on a PrintableResult, to enable JUnit self-tests. For example:
 assertThat(testResult(HasExpectedException.class), isSuccessful());
 
  • Constructor Details

    • ResultMatchers

      @Deprecated public ResultMatchers()
      Deprecated.
      will be private soon.
      Do not instantiate.
  • Method Details

    • isSuccessful

      public static org.hamcrest.Matcher<PrintableResult> isSuccessful()
      Matches if the tests are all successful
    • failureCountIs

      public static org.hamcrest.Matcher<PrintableResult> failureCountIs(int count)
      Matches if there are count failures
    • hasSingleFailureContaining

      public static org.hamcrest.Matcher<Object> hasSingleFailureContaining(String string)
      Matches if the result has exactly one failure, and it contains string
    • 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

      public static org.hamcrest.Matcher<PrintableResult> hasFailureContaining(String string)
      Matches if the result has one or more failures, and at least one of them contains string