How to use EditorActionTestCase with Maia

Can anybody give me a pointer as to what I need to do to get EditorActionTestCase based tests working? I've written a test and made sure that the action ID matches that specified in my plugin.xml file, but when I try to run it I just get the following error:

junit.framework.AssertionFailedError: Can't create document for 'BarfBackwards'

    at com.intellij.testFramework.LightPlatformCodeInsightTestCase.a(

    at com.intellij.testFramework.LightPlatformCodeInsightTestCase.configureFromFileText(

    at com.intellij.testFramework.EditorActionTestCase.doTextTest(

    at com.intellij.testFramework.EditorActionTestCase.doTextTest(

    at org.jetbrains.plugins.clojure.actions.editor.BarfBackwardsTest.testBarfBackwards(

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    . . .

I'd previously tried writing tests for editor actions without using this class and it seems problematic at best. What's the recommended way of testing simple editor actions?

1 comment
Comment actions Permalink

Doh! I just needed to make sure my file name had an extension matching my target language! Like this:

    doTextTest("BarfBackwards.clj", "(a (b<caret> c) d e)", "(a b (c) d e)");


Please sign in to leave a comment.