Setup completition provider in the LightPlatformCodeInsightFixture4TestCase Follow
I want to test my completition provider. How do I set it up in TestFixture -
LightPlatformCodeInsightFixture4TestCase
It looks like SDK test framework does not use plugin.xml
Please sign in to leave a comment.
Please describe the problem in detail. Did you double-check the classpath you're running the test with?
I ran my test from Intellij, it takes care about classpath
Here is the test
The class that extends CompletionContributor is in the same package and is in the classpath. This provider configured in plugin.xml. But it does not look like plugin.xml is even used by testing framework, because I intentionally made an error in xml and test failed for exact same reason.
So the question is how do I configure and unit test my Competition provider?
What happens when you rename plugin.xml to nothing.xml? Does it work if you extend from BasePlatformTestCase instead? How do you setup your project?
The same happens in both cases.
My project is a gradle project. It was created from Intellij
I also checked out original project that is used for this tutorial - https://www.jetbrains.org/intellij/sdk/docs/basics/testing_plugins/test_project_and_testdata_directories.html
If I comment out
in
https://raw.githubusercontent.com/JetBrains/intellij-sdk-docs/master/code_samples/simple_language_plugin/resources/META-INF/plugin.xml
com.simpleplugin.SimpleCodeInsightTest#testCompletion test is still green. So it is not clear what this test is actually testing and how this Intellij SDK test framework actually works.
(1)
is not used in com.simpleplugin.SimpleCodeInsightTest#testCompletion as it tests completion in Java file CompleteTestData.java, not completion from SimpleCompletionContritor operating in "Simple" language only
(2) could you provide ZIP or source repository of your plugin to reproduce the problem? Thanks