-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Introduce extension APIs to handle exceptions from lifecycle callback methods #1868
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
Conversation
15d4bca to
083a233
Compare
|
@JockX Thanks for the PR! We'll discuss it in the next team meeting this Friday. |
|
Team Decision: Please put all of the new methods into a single |
|
@JockX Thanks for updating the PR! Please run |
d1cf4cc to
857a1db
Compare
|
@marcphilipp I would appreciate some help regarding the failure in azure tests. Does not seem to be related to the changes introduced in this PR |
|
No, that's related to me merging #1885, I'm afraid. I'll try to fix it ASAP. |
|
@JockX It's fixed in |
Implement LifecycleMethodExecutionExceptionHandler allowing extensions to intercept the exceptions thrown during execution of methods annotated with `@BeforeAll`, `@BeforeEach`, `@AfterEach` and `@AfterAll` before they propagate. Issue junit-team#1454
…xceptionHandler Issue junit-team#1454
marcphilipp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for rebasing! This looks very promising!
documentation/src/test/java/example/exception/MultipleHandlersTestCase.java
Show resolved
Hide resolved
documentation/src/test/java/example/exception/MultipleHandlersTestCase.java
Outdated
Show resolved
Hide resolved
documentation/src/test/java/example/exception/RecordStateOnErrorExtension.java
Show resolved
Hide resolved
Co-Authored-By: Marc Philipp <[email protected]>
sormuras
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Especially the LifecycleMethodExecutionExceptionHandlersTests class. 👍
sbrannen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all of the work on this PR.
I think this is good enough to be merged into master now. The implementation looks solid, and we can polish documentation, etc. after the merge.
@JockX, can you please provide the source for the PNG you have supplied?
There are some inconsistencies in the image, and it would be great if anyone in the community can update the image.
Also, please rebase on the current master and resolve conflicts. The PR should then be ready to merge.
|
Actually, I'll see if I can merge this PR and resolve the conflicts myself. So, please hold off on making any further changes at this time. |
|
@sbrannen, the png is a screenshot of a word document I created to more or less mimic the original. Should I put it in the repo? How is this usually handled? |
Yes, that would be great! 👍
Funny you should ask... for this particular graphic, the original author lost the original source, meaning we've had no way to edit it. So now that you have a "source", we would be very grateful to gain access to it. 😉 |
|
Note that this PR was further refined in 8aaac85. |
Overview
This change is an alternative take on issue #1454 based on still not merged PR #1509. In this version there are separate interfaces supporting exception handling in each of
@BeforeAll,@BeforeEach,@AfterEachand@AfterAll, so that it is not forced on the handler to implementhandleTestExecutionExceptionin addition tohandle(Before/After)(/All/Each)ExecutionExceptionI hereby agree to the terms of the JUnit Contributor License Agreement.
Definition of Done
@APIannotations