04 - Android单元测试
来源:互联网 发布:洛氏霍克指标源码 编辑:程序博客网 时间:2024/05/01 14:28
manifest中:
。。。
<uses-library android:name="android.test.runner" />
</application>
<uses-sdk android:minSdkVersion="8" />
<instrumentation
android:label="test my app"
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="cn.itcast.app" />
</manifest>
public class PersonServiceTest extends AndroidTestCase {public void testSave() throws Exception{PersonService ps =new PersonService();ps.save(null);}public void testAdd() throws Exception{PersonService ps =new PersonService();Assert.assertEquals(3, ps.add(1, 2));}}
日志打印 logcat
public class PersonServiceTest extends AndroidTestCase {public void testLogOut() throws Throwable{//Log.i("123", "你么");System.out.println("sdf你没");}
System.out.println("sdf你没"); 对应info
06-12 12:12:02.521: I/ System.out(738): sdf你没
System.err.println(""); 对应警告
0 0
- 04 - Android单元测试
- android 单元测试
- Android单元测试
- Android单元测试
- android单元测试
- Android单元测试
- Android单元测试
- android单元测试
- android单元测试
- Android单元测试
- Android单元测试
- android 单元测试
- android 单元测试
- Android--单元测试
- android单元测试
- Android单元测试
- Android单元测试
- Android单元测试
- ASP.NET面试题(含答案)
- java.lang.IllegalStateException异常产生的原因及解决办法
- 关于win8
- 青春,用眼泪来沉淀
- C#人事管理系统开发(3)创建项目
- 04 - Android单元测试
- 成绩排列
- 【网络协议】UDP协议
- android systemui 分析-Notification 是怎么来到 通知栏并显示的?
- Hibernate 4.3关于org.hibernate.service.jndi.JndiException: Error parsing JNDI name [foo]等异常
- C#人事管理系统开发(4)公共类设计
- java 中String与StringBuilder 效率
- hibernate4.3中SessionFactory的创建
- loadrunner性能测试——第一步 录制脚本