-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update TestWatcher Javadoc to specify that it should be the "outer" rule #1436
Comments
The ordering of rules is undefined. If you need to enforce ordering between rules, you can use |
@Gaibhne do you have any suggestions for how you could have discovered |
The ordering of rules is address by #1445 |
While ordering fixes the issue, what happens is not actually something that SHOULD be something that depends on the order of the rules, so there is no way I would have ever gotten the idea to read any documentation relating to rule orders. Don't get me wrong, as a programmer, I see why it happens the way it does, but that is only in hind sight. Nothing but a meaningful error or warning message could have pointed me towards looking into rule ordering mechanisms. I'm not sure if it is feasible to produce any sort of error or warning for a scenario like this. In the end, the bug is that the TestWatcher follows different rules, no pun intended, about what is considered a failure or a success than JUnit. |
This issue can be addressed in the following ways:
|
I think updating the Javadoc of |
TestWatcher may see failed tests as successful and vice versa if it is not the outermost rule and another rule changes the result of a test (e.g. ErrorCollector or ExpectedException). Fixes junit-team#1436.
TestWatcher may see failed tests as successful and vice versa if it is not the outermost rule and another rule changes the result of a test (e.g. ErrorCollector or ExpectedException). Fixes junit-team#1436.
TestWatcher may see failed tests as successful and vice versa if it is not the outermost rule and another rule changes the result of a test (e.g. ErrorCollector or ExpectedException). Fixes junit-team#1436.
TestWatcher may see failed tests as successful and vice versa if it is not the outermost rule and another rule changes the result of a test (e.g. ErrorCollector or ExpectedException). Fixes junit-team#1436.
TestWatcher may see failed tests as successful and vice versa if it is not the outermost rule and another rule changes the result of a test (e.g. ErrorCollector or ExpectedException). Fixes junit-team#1436.
TestWatcher may see failed tests as successful and vice versa if it is not the outermost rule and another rule changes the result of a test (e.g. ErrorCollector or ExpectedException). Fixes junit-team#1436.
Depending on the field name of the ExpectedException rule, the rule works or breaks when used in conjunction with a TestWatcher. More details, as well as a test case demonstrating the faulty behaviour, can be seen at:
http://stackoverflow.com/questions/43088543/junit-test-both-passes-and-fails-conflict-using-both-expectedexception-and-tes
The text was updated successfully, but these errors were encountered: