首页 > 移动平台 > 详细

Android测试框架1(非原创)

时间:2015-12-23 09:14:29      阅读:211      评论:0      收藏:0      [点我收藏+]

1.继承AndroidTestCase :public class JunitTest3 extends AndroidTestCase {}

2.在AndroidManifest.xml清单文件中添加如下代码:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.showdata"
android:versionCode="1"
android:versionName="1.0" >


<instrumentation
  android:name="android.test.InstrumentationTestRunner"
  android:targetPackage="com.example.showdata" >
</instrumentation>

<application
  android:allowBackup="true"
  android:icon="@drawable/ic_launcher"
  android:label="@string/app_name"
  android:theme="@style/AppTheme" >
  

  <uses-library android:name="android.test.runner"/>

  <activity
    android:name="com.example.showdata.MainActivity"
    android:label="@string/app_name" >
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />

    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
  </activity>

 

3.在要测试的方法上右击-->Run As --->Android Junit Test、需要先打开模拟器

 

Android测试框架1(非原创)

原文:http://www.cnblogs.com/biao2015/p/5068785.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!