Class ResultMatchers


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

      Constructors 
      Constructor Description
      ResultMatchers()
      Deprecated.
      will be private soon.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.hamcrest.Matcher<PrintableResult> failureCountIs​(int count)
      Matches if there are count failures
      static org.hamcrest.Matcher<PrintableResult> hasFailureContaining​(java.lang.String string)
      Matches if the result has one or more failures, and at least one of them contains string
      static org.hamcrest.Matcher<java.lang.Object> hasSingleFailureContaining​(java.lang.String string)
      Matches if the result has exactly one failure, and it contains string
      static org.hamcrest.Matcher<PrintableResult> hasSingleFailureMatching​(org.hamcrest.Matcher<java.lang.Throwable> matcher)
      Matches if the result has exactly one failure matching the given matcher.
      static org.hamcrest.Matcher<PrintableResult> isSuccessful()
      Matches if the tests are all successful
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ResultMatchers

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

      • hasSingleFailureContaining

        public static org.hamcrest.Matcher<java.lang.Object> hasSingleFailureContaining​(java.lang.String string)
        Matches if the result has exactly one failure, and it contains string
      • hasSingleFailureMatching

        public static org.hamcrest.Matcher<PrintableResulthasSingleFailureMatching​(org.hamcrest.Matcher<java.lang.Throwable> matcher)
        Matches if the result has exactly one failure matching the given matcher.
        Since:
        4.13
      • hasFailureContaining

        public static org.hamcrest.Matcher<PrintableResulthasFailureContaining​(java.lang.String string)
        Matches if the result has one or more failures, and at least one of them contains string