android 单元测试
来源:互联网 发布:js 函数返回true 编辑:程序博客网 时间:2024/04/28 04:40
步骤:
第一步:
在AndroidManifes.xml主配置文件中加入如下单元配置信息:
* 1.引入单元测试的包
* //注意位置关系 第一个配置必须放在 </application>与<activity>之间
* <uses-libarary android:name="android.test.runner" />
2.引入单元测试入口
* //第二个配置的targetPackage包必须与开头的 package="com.smu.log"一致
* <manifest>与<application>之间
<instrumentation android:name="android.test.InstrumentationTestRunner"
android:targetPackage="com.smu.log"
android:label="Tests fro My App" />
第二步:
编写单元测试代码 必须去继承AndroidTestCase类
如: public class LogTest extends AndroidTestCase
第三步:
在测试的方法右击 Run As -> Android Junit Test 取可进行单元的测试
调试输出信息是Log.i(tag,"自己写的输出信息");而不是采用System.out.println();
- android 单元测试
- Android单元测试
- Android单元测试
- android单元测试
- Android单元测试
- Android单元测试
- android单元测试
- android单元测试
- Android单元测试
- Android单元测试
- android 单元测试
- android 单元测试
- Android--单元测试
- android单元测试
- Android单元测试
- Android单元测试
- Android单元测试
- ANDROID 单元测试
- 求一定范围内的素数个数
- C语言自学笔记-第1章 C语言概述
- 健康的生活作息表
- 数据结构--线性表操作
- Ext Js 3.2 Viewport使用
- android 单元测试
- 发现一个iis 重定向的bug
- STL中list的使用
- unicode与GB2312的相互转换(js)
- xm create创建DomU源码分析
- 各种函数 (备忘)
- 淘宝API图片尺寸的缩略图解决办法
- C# 使用正则表达式去掉字符串中的数字,或者去掉字符串中
- jObject.js lets you sleep earlier