https://github.com/mike-ensor/expected-failure
Provides functionality for a JUnit test to mark a test case as being expected to fail
https://github.com/mike-ensor/expected-failure
Last synced: 5 months ago
JSON representation
Provides functionality for a JUnit test to mark a test case as being expected to fail
- Host: GitHub
- URL: https://github.com/mike-ensor/expected-failure
- Owner: mike-ensor
- Created: 2012-09-10T03:06:22.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2013-01-14T04:44:05.000Z (over 13 years ago)
- Last Synced: 2025-07-04T13:38:29.013Z (12 months ago)
- Language: Java
- Size: 473 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Project documentation: http://mike-ensor.github.com/expected-failure/
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 {
@Rule
public ExpectedException exception = ExpectedException.none();
@Rule
public ExpectedTestFailureWatcher expectedTestFailureWatcher = ExpectedTestFailureWatcher.instance();
@Test
@ExpectedFailure("The matcher should fail becasue exception is not a SimpleException")
public void assertSimpleExceptionAssert_exceptionIsOfType() {
// expected exception will be of type "SimpleException"
exception.instanceOf(SimpleException.class);
// throw something other than SimpleException...expect failure
throw new RuntimeException("this is an exception");
}
}