From: denis k. <den...@ma...> - 2002-09-19 05:34:38
Hi -
is there a way to get a method to raise an exception in a mockobject?
But then, should I be doing this? should I be trying to test the
exception handling code I've written?
regards,
dk-
There isn't a generic method for throwing exception but there are place
in the code which support throwing specific exceptions. e.g.
http://www.mockobjects.com/javadoc/1.3/com/mockobjects/sql/CommonMockMultiRowResultSet.html#setupThrowExceptionOnGet(java.sql.SQLException)
Yes exceptions should be tested for (Though I suspect that it's not done
nearly enough). This is one of the big advantages of mocks.
On Thu, 2002-09-19 at 06:33, denis krizanovic wrote:
>
> Hi -
>
> is there a way to get a method to raise an exception in a mockobject?
> But then, should I be doing this? should I be trying to test the
> exception handling code I've written?
>
> regards,
> dk-
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Mockobjects-java-dev mailing list
> Moc...@li...
> https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev
--
jeff martin
information technologist
mkodo limited
mobile: 44 (0) 78 5547 8331
phone: 44 (0) 20 2226 4545
email: je...@mk...
www.mkodo.com