Check if an exception is thrown during my JUnit test
843789Feb 11 2010 — edited Feb 12 2010Hi all,
I've been writing unit tests for the application I'm writing.
I'm trying to write one very generic test which will simply open up the application, press some buttons, and close it back down, and confirm that no exceptions were thrown at any time during the test.
Unfortunately, while I figured I could just wrap the whole thing in a try/catch block, it seems that I have an exception that is being thown in the AWT-EventQueue which isn't being caught. The test passes fine, but I want it to fail.
What is the best way to go about checking for this? Should I be running the test in the event queue? Or should I have my own error handler to catch the exceptions?
Thanks!
Tim