Skip to content

Commit

Permalink
IOConsoleTests: try to show all errors
Browse files Browse the repository at this point in the history
  • Loading branch information
EcljpseB0T authored and jukzi committed Sep 10, 2024
1 parent 0870681 commit 1cc6bce
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

/**
Expand Down

0 comments on commit 1cc6bce

Please sign in to comment.