Test coverage on reflected code
Hi,
I'm working on a home project that reflects upon an annotated POJO object-graph and does something cool with its structure. Right now my tests all pass. If I turn on code-coverage though, most of them fail. This seems to be because the coverage tools are proxying my classes and therefore reflection is returning different structures to those I expect (that is, I'm not finding POJOs any more).
Is this meant to happen? Can I really not use coverage tools on this code?
Bryan
Please sign in to leave a comment.
Hello TCS,
Could you please send me a portion of code which doesn't work with coverage?
BTW what coverage engine do you use?
Thank you
-
Anna Kozlova
JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
i have this problem when using Spring JavaConfig. Presumably due to the cglib enhancements done at runtime?
yuo can reate a 1 bean appcontext and see the code coverage fail. it only fails with the IDEA runner, EMMA works. see JavaConfig examples here: http://static.springframework.org/spring-javaconfig/docs/1.0.0.M4/reference/html/ch03.html
Hi Anna,
Can you give me your email address and I'll email the code to you? It's too big to post here (around a dozen classes). This problem occurs with both IDEA and Emma engines, and both in tracking and sampling mode.
Bryan
Hello TCS,
Sure anna.kozlova@jetbrains.com
Thank you
-
Anna Kozlova
JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"