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(LightPlatformCodeInsightTestCase.java:170)
at com.intellij.testFramework.LightPlatformCodeInsightTestCase.configureFromFileText(LightPlatformCodeInsightTestCase.java:88)
at com.intellij.testFramework.EditorActionTestCase.doTextTest(EditorActionTestCase.java:58)
at com.intellij.testFramework.EditorActionTestCase.doTextTest(EditorActionTestCase.java:45)
at org.jetbrains.plugins.clojure.actions.editor.BarfBackwardsTest.testBarfBackwards(BarfBackwardsTest.java:55)
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?
Cheers,
Ian.
Please sign in to leave a comment.
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)");
:-)