IntelliJ IDEA 13.1.0 Web Help

With IntelliJ IDEA you can generate and run unit tests for your Android applications using Android Testing Framework. Unit tests are stored in a dedicated module related to the target tested module. Each module to be tested requires a separate test module. For executing unit tests, IntelliJ IDEA provides an Android-specific run configuration.

Unit testing in Android applications involves the following general steps:

To create a module for android unit tests
  1. Create an Android module from scratch.
  2. On the last page of the Wizard, choose the Test option.
  3. Specify the module to run unit tests against in the Tested Module drop-down list.
  4. Click Finish.

    Tip

    To have a dedicated run configuration of the type Android Test created, click Yes in the Create Android Run Configuration dialog box that opens.

To generate unit tests for an android application
  1. When you click Finish on the last page of the new module Wizard, IntelliJ IDEA creates a module with the specified name and a stub test class for your main activity with the default name <main activity class name>Test.
  2. Complete the stub and populate the test module as necessary.
To run unit tests for an android application, perform these general steps

See Also

Concepts:

Procedures:

Reference:

External Links:

Web Resources: