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()); } /**