I'm trying to use Google's CodePro Coverage tool to measure the coverage of my unit tests on a Google AppEngine project. However I'm getting various ClassFormatError exceptions on running the tests.
Have others got Google CodePro coverage working with a Google Appengine project?
Here are the lines of enquiry I'm pursuing:
a) Multiple levels of byte code engineering not working together. I.e. CodePro is fighting the GAE JPA implementation (DataNucleus instruments persistent classes).
b) Some RTFM error on my part
Here is the exception:
java.lang.ClassFormatError: Invalid length 65525 in LocalVariableTable in class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Here's an answer to my own question, but I don't like it much.
I made a completely new eclipse coverage project, and instrumented this project with CodePro. In this coverage project I included the source code for my GAE project and my unit test project. I made a boilerplate class in the coverage project that uses JUnitCore to call the JUnit TestCases in the unit test project.
Results for the GAE project are not displayed until you do at least one run with that project instrumented. The coverage run view then appears to publish stats against that project.
It feels really ugly and I'm really not very impressed with CodePro. It's under par for a google tool.
I've also looked into using the codepro ant tasks however the coverage instrumentation task has gone. It used to be called when it was part of instantiations CodePro product.
I think I shall look at simply using EMMA (on which CodePro is based). Long term I need coverage reports to be generated from an automated build. Something that doesn't appear possible with CodePro.