Android-Junit-TestCase-ClassLoader 讨论下Android的单元测试
2010-08-21 06:18:00 来源:WEB开发网< /application>
< uses-sdk android:minSdkVersion="7" />
< instrumentation android:targetPackage="com.demo.contact"
android:name="android.test.InstrumentationTestRunner" />
< /manifest>
异常栈:
Java代码
java.lang.NoClassDefFoundError: android/database/Cursor
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
Caused by: java.lang.ClassNotFoundException: android.database.Cursor
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 10 more
java.lang.NoClassDefFoundError: android/database/Cursor
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
Caused by: java.lang.ClassNotFoundException: android.database.Cursor
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
更多精彩
赞助商链接