JUnit Eclipse - Display stack trace on success
eclipse, java, junit4
Solution
You shouldn't need to do that.
Use the `@Test` annotation with an `expected` argument:
@Test(expected=MyAppException.class)
If the test does not throw the exception it's a test failure.
There should be an Eclipse view option to show test logging output, but in general, explicit logging from tests isn't valuable. You can also debug your test if you don't trust the JUnit annotations.
Problem
I'm writing some unit tests in eclipse which expect exceptions to be thrown. I wonder if there is an option to display the stack-trace when a test passes, it would be useful when you are writing test for the first time to check if the exception is been thrown really due to the case you are testing. thanks!