IntelliJ Platform Plugin SDK Help

1. Tests Prerequisites

This page discusses the steps to configure a plugin project for creating tests.

Create a Folder for Tests

Open the plugin project and create a separate folder named test under the src directory. Under test, create the java folder for test source code, and the folder testData for test data files and reimport the Gradle project.

└── src ├── main │ ├── java │ └── resources └── test ├── java └── testData

Set the Run Configuration Parameters

Because some of the tests use Java files as test data, the tests need to mock up the project's SDK. The testing framework uses java/mockJDK-$JAVA_VERSION$ from IntelliJ Community sources by default when using LightJavaCodeInsightFixtureTestCase test base class.

The system properties are defined in the build.gradle file using the snippet shown below. The /path/to/intellij-community/ is set to the absolute path to the local IntelliJ Community project source's root directory on the machine running the tests. For example, on macOS it might be /Users/$USER_NAME$/Documents/intellij-community/

test { systemProperty "idea.home.path", "/path/to/intellij-community/" }
Last modified: 03 June 2021