读书人

ndroid junit入门(4)Service测试

发布时间: 2012-06-27 14:20:09 作者: rapoo

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);}}

读书人网 >移动开发

热点推荐