other register

Wednesday, June 23, 2010

shouldFail in Groovy Testing

If the program hasn't got code to catch the runtime unchecked exceptions, then shouldFail can be used during groovy testing.

shouldFail() allows you to check that a particular lock of code throws an exception.

shouldFail (NullPointerException) {

However runtime unchecked exceptions can sometimes be considered as bugs in the programme and should be dealt with.

No comments: