ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gintautas Grigelionis <g.grigelio...@gmail.com>
Subject Re: Unit tests in Ivy and Ant
Date Tue, 05 Dec 2017 17:49:16 GMT
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) <apache@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.grigelionis@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-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message