Skip to content
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

Conversation

alb-i986
Copy link
Contributor

.. 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.

.. 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.
@marcphilipp
Copy link
Member

I don't like the duplication with RunAfters but besides that it looks good to me.

@junit-team/junit-committers Please take a look!

try {
base.evaluate();
} catch(Throwable t) {
Copy link
Member

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"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks.

Copy link
Member

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?

@kcooney
Copy link
Member

kcooney commented Jul 13, 2016

LGTM other than very minor style issues

after();
try {
after();
} catch(Throwable t) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same issue here, too

@kcooney kcooney closed this in c07965a Jul 16, 2016
@kcooney
Copy link
Member

kcooney commented Jul 16, 2016

I fixed the style issues and merged it. Thanks!

@alb-i986 would you please update the release notes?

@alb-i986
Copy link
Contributor Author

alb-i986 commented Jan 24, 2017

would you please update the release notes?

@kcooney Done. Sorry for the delay.

@alb-i986 alb-i986 deleted the fix-ExternalResource-test-failure-lost branch March 1, 2017 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants