jeudi 31 mars 2016

Gradle TestListener logging

I've written a GradleTestListener (implements org.gradle.api.tasks.testing.TestListener) and registered this in build.gradle

test{addTestListener(new com.abcd.GradleTestAdaptor())}

This test listener uses a third party library which is printing a warning + stacktrace via Slf4J to the console. This is causing a lot of noise in the test output so I would like to suppress it. I have configured Slf4j & Log4J as dependencies on my project and placed log4j.xml with root level error in src/test/resources. The warning is still being printed so it appears my logging configuration is not being picked up.

I'm wondering, as the TestListener is part of the build (akin to a plugin), will it pick up my logging configuration? If not, make it so?

Aucun commentaire:

Enregistrer un commentaire