Hello!
2012/6/19 henry <
henry...@googlemail.com>:
> This looks to be an issue with classpath order and slf4j.
>
>
> 0.26 didn't guarantee that the classpath was in the same order as when tests
> were run in surefire. This was fixed in 0.27and seems to resolve this issue,
> so if you update your pom the sl4j issue should go away.
Upgrade to 0.27 helped with my example, but tests for app are still
failing with slf4j error:
15:24:40 PIT >> INFO : Found 53 classes that might define tests
15:24:44 PIT >> INFO : Sent tests to slave
stderr : 15:24:45 PIT >> INFO : Found 303 tests
15:24:45 PIT >> INFO : Dependency analysis reduced number of potential
tests by 0
15:24:45 PIT >> INFO : 303 tests received
15:24:45 PIT >> INFO : Running 303 units
SLF4J: Class path contains multiple SLF4J bindings.
stderr :
SLF4J: Found binding in
[jar:file:/home/chollya/.m2/repository/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in
[jar:file:/home/chollya/.m2/repository/org/glassfish/extras/glassfish-em
stderr : bedded-all/3.0/glassfish-embedded-all-3.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See
http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
15:24:48 PIT >> WARNING : Description
[testClass=junit.framework.TestSuite$1,
name=warning(junit.framework.TestSuite$1)] did not pass without
mutation.
stderr : 15:24:48 PIT >> INFO : Finished
15:24:48 PIT >> INFO : Calculated coverage in 8 seconds.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] fail
Embedded error: All tests did not pass without mutation when
calculating line coverage. Mutation testing requires a green suite.
See
http://pitest.org for more details
> I think this might be diversion however - the original stack trace you
> posted showed a null pointer unrelated to sl4j. Can you confirm if you still
> have this problem using 0.27?
I believe it was because unitils uses slf4j internally, so it failed
with wrong slf4j initialization order.
Anyway, it's quite obvious that i have broken slf4j setup in my test
environment, but i'm not interested in working slf4j in tests at all
;) glassfish-embedded is only used for some integration test and as a
implementation of some servlet related classes, so it's not an issue
in production. Surefire is quite tolerate to this issue. I believe
pitest could forgive me slf4j errors too:)