Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
10.0
-
None
-
win 10, x64, open jdk 11.0.2
Description
Suppressed Exceptions are not visible to users in the "Test Results" window and the console. Junit 5 is using this to report several exceptions in one test (see org.junit.platform.engine.support.hierarchical.ThrowableCollector#add)
Console-Output:
doSomething Time elapsed: 0.016 s <<< ERROR! java.lang.IllegalStateException: the exception at com.company.DummyTest.doSomething(DummyTest.java:25) Caused by: java.lang.IllegalStateException: the cause at com.company.DummyTest.doSomething(DummyTest.java:25)
Code to reproduce:
@org.junit.jupiter.api.Test public void doSomething() { IllegalStateException dummy = new IllegalStateException( "the exception", new IllegalStateException("the cause") ); dummy.addSuppressed(new IllegalStateException("the suppressed")); throw dummy; }