org.junit.experimental.results
Class ResultMatchers

java.lang.Object
  extended by 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 Summary
ResultMatchers()
          Deprecated. will be private soon.
 
Method Summary
static Matcher<PrintableResult> failureCountIs(int count)
          Matches if there are count failures
static Matcher<PrintableResult> hasFailureContaining(String string)
          Matches if the result has one or more failures, and at least one of them contains string
static Matcher<Object> hasSingleFailureContaining(String string)
          Matches if the result has exactly one failure, and it contains string
static Matcher<PrintableResult> hasSingleFailureMatching(Matcher<Throwable> matcher)
          Matches if the result has exactly one failure matching the given matcher.
static 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

isSuccessful

public static Matcher<PrintableResult> isSuccessful()
Matches if the tests are all successful


failureCountIs

public static Matcher<PrintableResult> failureCountIs(int count)
Matches if there are count failures


hasSingleFailureContaining

public static Matcher<Object> hasSingleFailureContaining(String string)
Matches if the result has exactly one failure, and it contains string


hasSingleFailureMatching

public static Matcher<PrintableResult> hasSingleFailureMatching(Matcher<Throwable> matcher)
Matches if the result has exactly one failure matching the given matcher.

Since:
4.13

hasFailureContaining

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



Copyright © 2002–2020 JUnit. All rights reserved.