????????????????????????????????????????????Android?н??е?Junit????????????????????????????AndroidTestCase????????????????????AndroidManifest.xml?????????????
????????Test??????AndroidTestCase??
package com.example.android_sms.test;
import com.example.android_sms.MainActivity;
import com.example.android_sms.service.CalcService;
import android.test.AndroidTestCase;
public class TestCalcService extends AndroidTestCase{
public void testAdd(){
CalcService service=new CalcService();
int result=service.add(6?? 1);
assertEquals(7?? result);
}
}
?????????????????
????<!-- instrumentation??????manifest????? -->
????<instrumentation
????android:name="android.test.InstrumentationTestRunner"
????android:label="Test for My App"
????android:targetPackage="com.example.android_sms" >
????</instrumentation>
????<!-- ??application????user-library??? -->
????<uses-library android:name="android.test.runner" />
???????Android Junit?????????Java??Junit??????????????????????—>Run As—>Android Junit Test
???????????????Android Junit????????