-
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
Fix ExternalResource: the test failure was lost.. #1335
Fix ExternalResource: the test failure was lost.. #1335
Conversation
.. when the test failed *and* closing the resource failed: only the exception coming from the after() method was propagated, as per semantics of the try-finally (see http://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.20.2). Finally, the new behavior is compatible with @after method semantics (see class RunAfters). Fixes junit-team#1334, point 1.
I don't like the duplication with @junit-team/junit-committers Please take a look! |
try { | ||
base.evaluate(); | ||
} catch(Throwable t) { |
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.
Style-nit : please put a space after "catch" (we use Google Java style which requires spaces around keywords like "if" and "catch"
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.
Fixed, thanks.
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.
Did you forget to push?
LGTM other than very minor style issues |
after(); | ||
try { | ||
after(); | ||
} catch(Throwable t) { |
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.
same issue here, too
I fixed the style issues and merged it. Thanks! @alb-i986 would you please update the release notes? |
@kcooney Done. Sorry for the delay. |
.. when the test failed and closing the resource failed:
only the exception coming from the after() method was propagated, as per semantics of the try-finally
(see http://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.20.2).
Finally, the new behavior is compatible with
@After
method semantics (see class RunAfters).Fixes #1334, point 1.