Reputation: 1532
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.
Upvotes: 4
Views: 4960
Reputation: 353
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/
Upvotes: -1
Reputation: 401877
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.
Upvotes: 2