Please have a look at Ivy master now.

There are still a couple of cases where fail() is used: one, where a clean
post-mortem is made impossible by mock listeners that include assertions
which fail and pelt the test with assertion errors; second, where an
assertion message is too expensive to construct beforehand.

Gintas

2017-12-04 18:00 GMT+01:00 Jan Matèrne (jhm) <apa...@materne.de>:

> IMO catching an exception only makes sense if you check that exception
> against certain assumptions or you expect that.
> Otherwise the test runner will catch that (not excepted) and mark the test
> as failed.
>
> If the current codebase differs from that, I would agree with simplifying
> that.
>
>
> Jan
>
> > -----Ursprüngliche Nachricht-----
> > Von: Gintautas Grigelionis [mailto:g.grigelio...@gmail.com]
> > Gesendet: Montag, 4. Dezember 2017 17:23
> > An: Ant Developers List
> > Betreff: Unit tests in Ivy and Ant
> >
> > Hello,
> >
> > I decided to spend some time on unit tests in Ivy and Ant; I did some
> > work on Ivy tests this summer and I feel that work is unfinished.
> >
> > In particular, there was a conversation about the use of fail(); my
> > feeling is that it is somewhat superfluous: there are assumptions for
> > (de)activating tests, assertions and expected exceptions, and that
> > should suffice for defining a test.
> >
> > The way fail() is used in Ivy now mostly looks like a rethrow of
> > unexpected exceptions to AssertionErrors (why?).
> >
> > So, in a nutshell: I would like to minimize try/catch and if/else in
> > unit tests and make them work without fail(). What do you think?
> >
> > Gintas
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
> For additional commands, e-mail: dev-h...@ant.apache.org
>
>

Reply via email to