From 162651821e4a5a6253d54d5b8559d220099a0a03 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Wed, 15 Apr 2020 19:44:16 +0200 Subject: [PATCH] sinttest: log unexpected Throwables thrown by runTests() Because we would not see those if the finally block also threw. --- .../smack/inttest/SmackIntegrationTestFramework.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java index b297445a4..b89402df8 100644 --- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java +++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java @@ -227,6 +227,11 @@ public class SmackIntegrationTestFramework { try { runTests(classes); } + catch (Throwable t) { + // Log the thrown Throwable to prevent it being shadowed in case the finally block below also throws. + LOGGER.log(Level.SEVERE, "Unexpected abort because runTests() threw throwable", t); + throw t; + } finally { // Ensure that the accounts are deleted and disconnected before we continue connectionManager.disconnectAndCleanup();