Skip to content

Commit ccbfc48

Browse files
EcljpseB0Tjukzi
authored andcommitted
IOConsoleTests: try to show all errors
eclipse-platform/eclipse.platform.ui#2245
1 parent 0870681 commit ccbfc48

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/IOConsoleTests.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,17 @@ public void tearDown() throws Exception {
133133
}
134134

135135
private void assertNoError() {
136+
String allErrors = loggedErrors.stream().map(IStatus::toString).collect(Collectors.joining(", "));
137+
AssertionError assertionError = new AssertionError("Test triggered errors in IOConsole: " + allErrors);
136138
loggedErrors.forEach(status -> {
137-
if (status.getException() != null) {
138-
throw new AssertionError("Test triggered errors in IOConsole", status.getException());
139+
if (status.getException() instanceof Throwable e) {
140+
assertionError.addSuppressed(e);
139141
}
140142
});
141-
assertTrue("Test triggered errors in IOConsole: " + loggedErrors.stream().map(IStatus::toString).collect(Collectors.joining(", ")), loggedErrors.isEmpty());
143+
if (assertionError.getSuppressed().length > 0) {
144+
throw assertionError;
145+
}
146+
assertTrue("Test triggered errors in IOConsole: " + allErrors, loggedErrors.isEmpty());
142147
}
143148

144149
/**

0 commit comments

Comments
 (0)