在AndroidManifest.xml中

在<application>中添加

<uses-library android:name="android.test.runner"/><!-- 单元测试 -->

在<manifest>中添加

<instrumentation android:name="android.test.InstrumentationTestRunner" android:targetPackage="cn.edu.database" android:label="Tests my app"></instrumentation> 

编写测试类,该类继承AndroidTestCase

public class MyTest extends AndroidTestCase {public void testSava() throws Exception{new ProductService(this.getContext()).save();}}

更多相关文章

  1. Android Instrumentation自动化测试框架
  2. Android外设存储设备的访问及测试
  3. Android中的自动测试(1)
  4. android随笔06——单元测试
  5. Android摄像头视频帧数据测试代码
  6. android sqilte3数据库大小的测试
  7. Android自动化测试之monkeyrunner基本要素(七)
  8. Android添加单元测试的方法与步骤
  9. 关于android单元测试结合SAX解析xml文件初步分析

随机推荐

  1. Cocos2d-x权限问题
  2. ListView滚动条问题
  3. Android(安卓)Studio3.1.2 build.gradle
  4. android ndk调用Log.getStackTraceString
  5. android adb 命令发送 keyevent
  6. Android(安卓)在某一页禁止home键返回
  7. 自定义全屏Dialog
  8. 动画 anim
  9. Appium API
  10. Android开发整理