ls1intum / Ares

The Artemis Java Test Sandbox. A JUnit 5 Extension for Easy and Secure Artemis Java Testing
https://ls1intum.github.io/Ares/
MIT License
18 stars 7 forks source link

ReflectionTestUtils: Add potential problem location to error message when student code throws an exception #265

Open Strohgelaender opened 1 year ago

Strohgelaender commented 1 year ago

Is your feature request related to a problem? Please describe. When using the Method ReflectionTestUtils:invokeMethod to execute student code, and the code of the student throws an exception, the following error message gets shown:

grafik

This message contains the exception type and message, but not where this exception was thrown.

Describe the solution you'd like Ares already has a feature to include the potential problem location to exception. This should be reused here and added to the test feedback.

Describe alternatives you've considered The current workaround is to use invokeMethodRethrowing instead of invokeMethod.

Ares-Version you are using 1.11.1

MaisiKoleni commented 1 year ago

This might be a more complex change, so I doubt I have time for that. It would probably involve copying the stack trace in ReflectionTestUtils.