Geeny 2011-07-01
1.在AndroidManfest.xml文件中加入以下红色代码:
<?xml version="1.0" encoding="utf-8"?>
<manifestxmlns:android="http://schemas.android.com/apk/res/android"
package="cn.itcast.db"
android:versionCode="1"
android:versionname="1.0">
<applicationandroid:icon="@drawable/icon"android:label="@string/app_name">
<uses-libraryandroid:name="android.test.runner"/>
<activityandroid:name=".MainActivity"
android:label="@string/app_name">
<intent-filter>
<actionandroid:name="android.intent.action.MAIN"/>
<categoryandroid:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity></application>
<uses-sdkandroid:minSdkVersion="8"/>
<instrumentationandroid:name="android.test.InstrumentationTestRunner"
android:targetPackage="cn.itcast.db"android:label="TestsforMyApp"/>
</manifest>2. 在测试类中extends AndroidTestCase