All,
We've bundled the most recent changes in the 4.7 branch into a
snapshot release here:
https://sourceforge.net/project/showfiles.php?group_id=15278&package_id=226053&release_id=679069
We think the new Interceptor support is a simple but powerful way to
get more control on how your methods are run and reported, and are
eager for feedback
David Saff
## Summary of Changes in version 4.7 ##
### Interceptors ###
- Interceptors allow very flexible addition or redefinition of the behavior
of each test method in a test class. For example, this class will
keep a log of each passing and failing test:
@RunWith(Interceptors.class)
public static class WatchmanTest {
private static String watchedLog;
@Interceptor
public StatementInterceptor watchman= new TestWatchman() {
@Override
public void failed(Throwable e, FrameworkMethod method) {
watchedLog+= method.getName() + " "
+ e.getClass().getSimpleName() + "\n";
}
@Override
public void succeeded(FrameworkMethod method) {
watchedLog+= method.getName() + " " + "success!\n";
}
};
@Test
public void fails() {
fail();
}
@Test
public void succeeds() {
}
}
For more on this feature, see http://www.threeriversinstitute.org/blog/?p=155
### Timeouts ###
- Tests that timeout now show the stack trace of the test thread.
### Docs ###
- Javadocs now link to online JDK javadocs (bug 2090230)
- Parameterized runner javadocs improved (bug 2186792)
- Fixed Javadoc code sample for AfterClass (2126279)
### Bug fixes ###
- Fixed: BaseTestRunner.getTest() requires class to extend TestCase (1812200)
- Fixed: Suite does not allow for inheritance in annotations (2783118)
|