????1??????е??????????????AndroidManifest.xml?н????????
??????1??<!-- ?????? manifest????·???  ??? instrumentation -->
????<instrumentation
????android:name="android.test.InstrumentationTestRunner"
????android:label="Tests for My App"
????android:targetPackage="com.xunfang.junit" />
??????????Щ????????????????????????????кü???????????????????
????targetPackage???????package???????????????????????????????????
??????2??<!--  ??????????  application????????-->
????<uses-library android:name="android.test.runner" />
????????????????????
???????????
????AndroidManifest.xml?е??????
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="16" />
<!-- ??????manifest?? -->
<instrumentation
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="com.xunfang.junit" >
</instrumentation>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<!-- ??????application????? -->
<uses-library android:name="android.test.runner"/>
<activity
android:name=".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>
</application>
?????????????б???????????????????е?????
???????????е????
????public class MyMath {
????public int add(int a?? int b ){
????return a + b;
????}
????}
??????????????
????public class MyJuniteTestCase extends AndroidTestCase {
????public void test(){
????MyMath my = new MyMath() ;
????assertEquals(10?? my.add(4?? 6)) ;
????}
????}
??????????裺
????(1) ???--?????--??Run As--??Android Jutil Test
????(2)????????????--????outLine????????????????--?????--??Run As--??Android Jutil Test