English 中文(简体)
我怎样才能用一个真正的应用物体 用Android Server ServiceTestCase
原标题:How can I use a real Application object with Android s ServiceTestCase

我试图测试一个需要真正应用对象的服务, 而不是服务测试系统提供的模拟应用软件。

我怎样才能在我的服务测试系统里 创建一个真正的应用程序对象?

问题回答

A 服务有两种固有的依赖性,即 Context 及其相关的 Application ServiceTestCase 框架允许您输入这些依赖性,从而在一个孤立的环境中对受控制的依赖性进行单位测试。

您不应该在测试中使用真正的 application , 但如果您知道您正在做什么, 您可以使用 < a href=" http:// developmenter.android.com/ reference/android/ test/ ServiceTestCase.html# setAppliation% 28android. app. apply% 29" rel=“ nofol” >ServiceTestCase.setApplication() 。





相关问题
Selenium not working with Firefox 3.x on linux

I am using selenium-server , selenium rc for UI testing in my application . My dev box is Windows with FireFox 3.5 and every thing is running fine and cool. But when i try to run selenium tests on my ...

Best browser for testing under Safari Mobile on Linux?

I have an iPhone web app I m producing on a Linux machine. What s the best browser I can use to most closely mimic the feature-limited version of Safari present on the iPhone? (It s a "slimmed down" ...

Code Coverage Tools & Visual Studio 2008 Pro

Just wondering what people are using for code coverage tools when using MS Visual Studio 2008 Pro. We are using the built-in MS test project and unit testing tool (the one that come pre-installed ...

Is there any error checking web app cralwers out there?

Wondering if there was some sort of crawler we could use to test and re-test everything when changes are made to the web app so we know some new change didn t error out any existing pages. Or maybe a ...

热门标签