IntelliJ IDEA 13.1.0 Web Help

Some features described here are available in Ultimate edition only.

IntelliJ IDEA enables creating and running unit and integration Grails tests, and provides run configurations for each test type.

To create Grails test, do one of the following:
  • Use scaffolding of a domain class you want to create a test for:

    grailsCreateTest1.png

  • Run Grails target: press Ctrl+Alt+GCtrl+Alt+GCtrl+Alt+GCtrl+Alt+GCtrl+Alt+GCtrl+Alt+GCtrl+Alt+GCtrl+Alt+GCtrl+Alt+GAlt Command GAlt Command GAlt Command G, and type the target name in the text field. Use code completion to narrow down the list of matching targets:

    grailsCreateTest2.png

To create a Grails test run/debug configuration
  1. In the Grails view, right-click one of the test directories, point to Create Run Configuration on the context menu, and then choose one of the suggested options:
    • Tests in...
    • Grails tests:...

    grails_createTestRunConfig

  2. In the Run/Debug Configuration dialog that opens, specify the run/debug configuration settings:test type, Grails scripts etc.

    Note

    You can specify several test names separated with spaces, all these tests will run in a single run configuration.

To run a Grails test
  1. In the Grails view, select the desired test class.
  2. In the menu that opens, select Run and the desired configuration type:

    grailsCreateTestConfig.png

    The selected run/debug configuration is executed in the Run tool window.

See Also

Concepts:

Procedures:

Reference:

Web Resources: