title |
---|
1. Tests Prerequisites |
Open the project with the plugin and create a separate folder "tests".
Mark the folder as a test source root via the context menu Mark Directory As
→ Test Source Root
.
In our tests we will use test data, so we need one more folder "testData" to store these files.
Since some of our tests will use Java files as test data, we need to mock up the project SDK. IntelliJ IDEA does everything automatically when we use the special utility class LightCodeInsightFixtureTestCase.
All we need to do is point the the run configuration's working directory to the root of the IntelliJ IDEA Community Edition sources and enable the following VM options:
-ea -Xbootclasspath/p:../out/classes/production/boot -XX:+HeapDumpOnOutOfMemoryError -Xmx512m -XX:MaxPermSize=320m -Didea.system.path=../test-system -Didea.home.path=../ -Didea.config.path=../test-config -Didea.test.group=ALL_EXCLUDE_DEFINED
Note:
Keep in mind that we have changed the working directory, so all the paths in tests extended from LightCodeInsightFixtureTestCase will use relative path to the source root of IntelliJ IDEA Community Edition.