[
https://issues.apache.org/jira/browse/IGNITE-11931?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16866921#comment-16866921
]
Ivan Pavlukhin commented on IGNITE-11931:
-----------------------------------------
[~ibessonov], there was added a following construct:
{code}
private void evaluateInsideFixture(Statement stmt) throws Throwable {
Throwable suppressed = null;
try {
beforeFirstTest();
stmt.evaluate();
}
catch (Throwable t) {
suppressed = t;
throw t;
}
finally {
try {
afterLastTest();
}
catch (Throwable t) {
if (suppressed != null)
t.addSuppressed(suppressed);
throw t;
}
}
}
{code}
I wonder why such logic is used. If an exception is thrown from both (outer)
try (_etry_) and finally (_efin_) blocks then _efin_ is rethrown with _etry_
added as suppressed. AFAIR, java _try-with-resources_ construct throws an
exception from try block and adds exception ocurred during close as suppressed.
So, why do not we follow the same logic (etry.addSuppressed(efin))? It seems
more natural to me. What do you think?
> Rewrite @WithSystemProperty handling using JUnit rules.
> -------------------------------------------------------
>
> Key: IGNITE-11931
> URL: https://issues.apache.org/jira/browse/IGNITE-11931
> Project: Ignite
> Issue Type: Test
> Reporter: Ivan Bessonov
> Assignee: Ivan Bessonov
> Priority: Major
> Labels: MakeTeamcityGreenAgain
> Fix For: 2.8
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> @WithSystemProperty can only be used in classes that inherit
> GridAbstractTest. This should be changed.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)