ndroid junit入门(四)Service测试
public class TestService extends ServiceTestCase<TService> {public TestService() {super(TService.class);}@Overrideprotected void setUp() throws Exception {super.setUp();}@SmallTestpublic void testPreconditions() {}/** * Test basic startup/shutdown of Service */@SmallTestpublic void testStartable() {Intent startIntent = new Intent();startIntent.setClass(getContext(), Test1Activity.class);startService(startIntent);}/** * Test binding to service */@MediumTestpublic void testBindable() {Intent startIntent = new Intent();startIntent.setClass(getContext(), Test1Activity.class);bindService(startIntent);}}