Android本地JUnit Text

时间:2015-09-06 21:33:35   收藏:0   阅读:186

Android本地JUnit Text

步骤

  1. 创建一个和source文件,里面添加和src目录相同的包。
  2. AndroidManifest.xml文件manifest根节点添加如下文件
 <instrumentation
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="com.zlpro.mobilesafe" >

</instrumentation>
  1. application节点下添加
<uses-library android:name="android.test.runner" />
  1. 创建一个要测试java文件继承AndroidTestCase类,在里面直接写要测试代码就可以了,
  2. 获取上下文getContext()

原文:http://www.cnblogs.com/ganwei/p/4787158.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!