Wrap uncaught exceptions in a testcase for JUnit.