ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: git commit: workwaround to fix unit tests as Hamcrest's IsCollectionContaining seems buggy
Date Thu, 28 Aug 2014 15:36:50 GMT
On 2014-08-28, <jlboudart@apache.org> wrote:

> workwaround to fix unit tests as Hamcrest's IsCollectionContaining seems buggy

actually, it is Hamcrest's isA matcher that is borked, stumbled over it
myself a few times.

> -        assertThat(project.getBuildListeners(), hasItem(isA(MultiModuleLogger.class)));

here isA(MultiModuleLogger.class) is a Matcher<MultiModuleLogger> rather
than a Matcher<?> or Matcher<Object>, this is pretty much useless.

In your case hasItem wants a Matcher<? super BuildListener> and
MultiModuleLogger is not a lower bound of BuildListener.

https://github.com/hamcrest/JavaHamcrest/issues/27

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message