How to use JavaCodeInsightFixtureTestCase


I've been trying to create a very simple test case for my plugin but no luck so far.

This is my test case:

public class FormatterActionHandlerTest extends JavaCodeInsightFixtureTestCase {
    public void testBasic() {
        Editor editor = myFixture.getEditor();

When I run it I get two problems:

1) editor variable is always null
2) junit.framework.AssertionFailedError: Cannot find source file: ''. getTestDataPath()='C:/Andre/.IntelliJIdea/system/plugins-sandbox/test'. getHomePath()='C:/Andre/.IntelliJIdea/system/plugins-sandbox/test'.

My project structure looks like this:

My Plugin
+--- src
+--- testSrc
+--- testData

I tried to override getBasePath() and getTestDataPath() methods and use PluginPathManager.getPluginHomePath() but it didn't work either...   

I'm running the tests from my plugin project... Am I missing something?


Please sign in to leave a comment.