From a963c7c2fce3e1a53925fa925696f46973a8f832 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Kubitz?= Date: Fri, 6 Sep 2024 08:55:08 +0200 Subject: [PATCH] IOConsoleTests: try to show all errors https://github.com/eclipse-platform/eclipse.platform.ui/issues/2245 --- .../eclipse/debug/tests/console/IOConsoleTests.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/IOConsoleTests.java b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/IOConsoleTests.java index 6c14d24049b..8a4876b1d9c 100644 --- a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/IOConsoleTests.java +++ b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/IOConsoleTests.java @@ -133,12 +133,17 @@ public void tearDown() throws Exception { } private void assertNoError() { + String allErrors = loggedErrors.stream().map(IStatus::toString).collect(Collectors.joining(", ")); + AssertionError assertionError = new AssertionError("Test triggered errors in IOConsole: " + allErrors); loggedErrors.forEach(status -> { - if (status.getException() != null) { - throw new AssertionError("Test triggered errors in IOConsole", status.getException()); + if (status.getException() instanceof Throwable e) { + assertionError.addSuppressed(e); } }); - assertTrue("Test triggered errors in IOConsole: " + loggedErrors.stream().map(IStatus::toString).collect(Collectors.joining(", ")), loggedErrors.isEmpty()); + if (assertionError.getSuppressed().length > 0) { + throw assertionError; + } + assertTrue("Test triggered errors in IOConsole: " + allErrors, loggedErrors.isEmpty()); } /**