On 22/02/2013, at 8:20 AM, Tomek Kaczanowski wrote:

> Hello,
> 
> I can not find way to instruct gradle to use JUnit listeners
> (extending JUnit TestWatcher). What should I put in the test {}
> section of my build.gradle so it uses com.mypackage.MyListener while
> running JUnit tests?

TestWatchers are just JUnit rules, so you use them the same way as any rule in 
JUnit: Attach the watcher to a test class as a field with an @Rule or 
@ClassRule annotation.


--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com

Reply via email to