+0, leaning to -0, mainly due to the lack of precision that could cause some not very obvious to debug test failures. What about this: https://code.google.com/p/catch-exception/ ? It seems to have a very flexible syntax and you don`t have (AFAICS) the drawback/issues pointed out by Denis. Thanks, Eduard On Wed, Jan 14, 2015 at 1:05 PM, Marius Dumitru Florea < [email protected]> wrote:
+1, although defining expectations is more like JMock than Mockito with respect to code style. I guess there's no way to verify the exception after invoking the component under test.
Thanks, Marius
On Sat, Jan 10, 2015 at 1:51 PM, [email protected] <[email protected]> wrote:
Hi devs,
I’d like to propose that we use the strategy described at https://github.com/junit-team/junit/wiki/Exception-testing (thanks to Lyes for pointing out this page to me).
For example:
@Test public void sendSynchronousWithErrors() throws Exception { ... this.thrown.expect(MessagingException.class); this.thrown.expectMessage("Some messages have failed to be sent for the following reasons: " + "[[[errorsummary1],[errordescription1]][[errorsummary2],[errordescription2]]]");
this.mocker.getComponentUnderTest().send(Arrays.asList(message), session); }
I feel it’s slightly better than our current idiom based on try/catch. One advantage is that we cannot forget to put the fail().
WDYT?
Thanks -Vincent
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs