solomax commented on code in PR #218:
URL: https://github.com/apache/openjpa/pull/218#discussion_r4266419633
##########
openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/AbstractCriteriaTestCase.java:
##########
@@ -371,6 +447,32 @@ public void runBare() throws Throwable {
}
}
+ /**
+ * Mirrors {@link junit.framework.TestCase#runBare()} except that {@code
setUp()} is
+ * covered by the try/finally, so {@code tearDown()} always releases what
{@code setUp()}
+ * opened. Both are called exactly once.
+ */
+ private void runBareReleasingResources() throws Throwable {
+ Throwable exception = null;
+ try {
+ setUp();
+ runTest();
+ } catch (Throwable running) {
+ exception = running;
+ } finally {
+ try {
+ tearDown();
+ } catch (Throwable tearingDown) {
+ if (exception == null) {
Review Comment:
do we need `addSuppressed` here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]