`

ndroid junit入门(四)Service测试

阅读更多
public class TestService extends ServiceTestCase<TService> {

	public TestService() {
		super(TService.class);
	}

	@Override
	protected void setUp() throws Exception {
		super.setUp();
	}

	@SmallTest
	public void testPreconditions() {
	}

	/**
	 * Test basic startup/shutdown of Service
	 */
	@SmallTest
	public void testStartable() {
		Intent startIntent = new Intent();
		startIntent.setClass(getContext(), Test1Activity.class);
		startService(startIntent);
	}

	/**
	 * Test binding to service
	 */
	@MediumTest
	public void testBindable() {
		Intent startIntent = new Intent();
		startIntent.setClass(getContext(), Test1Activity.class);
		bindService(startIntent);
	}

}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics