开发者

Set up Android testing in Intellij IDEA

Have someone got any tutorials for how to do testing on Android in Intellij? I am 开发者_开发问答looking for resources similar to what you find for Eclipse with the ability to create a test project for my android project.


You can find some help in the IDEA forum thread.

Tests for Android application should be located in a separate module with its own AndroidManifest.xml file. To find out how to create tests for your Android application, you can use samples in Android SDK (i.e. "Snake" sample).

Create IDEA project from existing sources. 2 modules with Android facets will be created automatically: base module and "tests". Then add dependency between these module and compile. If compilation is successful, open some test class (i.e. "SkeletonAppTest" in "Snake" sample) in editor and select Run->SkeletonAppTest (with Android icon) in the popup menu: tests will run on emulator or device. You can create Android Tests run configuration to run tests in different scopes.

Unfortunately, IDEA 9 doesn't have an option to create test module for some base Android module. You can create it using SDK command-line tool.


Here's the general Android/Eclipse info:

Android testing overview: http://developer.android.com/guide/topics/testing/index.html

Testing practicalities for Eclipse and command line: http://developer.android.com/guide/developing/testing/index.html

Tutorial: http://developer.android.com/resources/tutorials/testing/helloandroid_test.html

and to create a test project in IntelliJ: http://blogs.jetbrains.com/idea/2010/09/android-unit-testing-support/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜