From: wang x. <xin...@gm...> - 2013-07-23 10:17:10
|
Hi all, Forgive me if this question is duplicate. Today I tried to use cobertura to measure the test code coverage of my Android app. I've two test cases code for two java files. The first java code has no Android API, so the test case runs fine, and can generate the code coverage. However, the second java code has Android API used, so the second test case failed to run. The error is as below: <error type="java.lang.NoClassDefFoundError" message="android/content/pm/PackageManager$NameNotFoundException"> java.lang.NoClassDefFoundError: android/content/pm/PackageManager$NameNotFoundException at com.test.MyUtilityTest.testupdateGLDCurrentOpenConversationItem2(MyUtilityTest.java:90) Caused by: java.lang.ClassNotFoundException: android.content.pm.PackageManager$NameNotFoundException at java.net.URLClassLoader$1.run(URLClassLoader.java:202) 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) </error> Could someone tell me how to use cobertura to measure code coverage with Android? Thanks a lot. |