Re: git commit: workwaround to fix unit tests as Hamcrest's IsCollectionContaining seems buggy

2014-08-28 Thread Stefan Bodewig
On 2014-08-28, jlboud...@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 MatcherMultiModuleLogger rather
than a Matcher? or MatcherObject, 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-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



Re: git commit: workwaround to fix unit tests as Hamcrest's IsCollectionContaining seems buggy

2014-08-28 Thread Stefan Bodewig
On 2014-08-28, Stefan Bodewig wrote:

 On 2014-08-28, jlboud...@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.

and you can use

new org.hamcrest.core.IsInstanceOf(MultiModuleLogger.class)

as an alternative (which works, while the instanceOf factory method has
the same problem as the isA matcher).

Stefan

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



Re: git commit: workwaround to fix unit tests as Hamcrest's IsCollectionContaining seems buggy

2014-08-28 Thread Jean-Louis Boudart
Thanks for the feedback Stefan :)


2014-08-28 17:40 GMT+02:00 Stefan Bodewig bode...@apache.org:

 On 2014-08-28, Stefan Bodewig wrote:

  On 2014-08-28, jlboud...@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.

 and you can use

 new org.hamcrest.core.IsInstanceOf(MultiModuleLogger.class)

 as an alternative (which works, while the instanceOf factory method has
 the same problem as the isA matcher).

 Stefan

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




-- 
Jean Louis Boudart
Independent consultant
Apache EasyAnt commiter http://ant.apache.org/easyant/