Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Provides functionality for a JUnit test to mark a test case as being expected to fail
Latest commit 96d236e @mike-ensor * Updating the version
Failed to load latest commit information.
code-analysis Adding site doc and code quality
src Adding site doc and code quality
.gitignore * Adding to git ignore Update
pom.xml * Updating the version

Project documentation:

This project creates a @Rule object to govern test cases and then provides the ability to annotate a test case with @ExpectedFailure allowing a test case that would fail to succeed.

In this example, the test case would normally fail given that the "exception" would fail based on the assertion in the exception assertion object

public class ExceptionAssertTest {

    public ExpectedException exception = ExpectedException.none();

    public ExpectedTestFailureWatcher expectedTestFailureWatcher = ExpectedTestFailureWatcher.instance();

    @ExpectedFailure("The matcher should fail becasue exception is not a SimpleException")
    public void assertSimpleExceptionAssert_exceptionIsOfType() {
        // expected exception will be of type "SimpleException"
        // throw something other than SimpleException...expect failure
        throw new RuntimeException("this is an exception");
Something went wrong with that request. Please try again.