OpenAPI testFramework sample usage ?


Hi,

I want to run some unit tests to actually see how the language lexer/parser
works in the context of IDEA but i don't want to pay the price of starting/stopping
IDEA all the time.
I looked around and saw the com.intellij.openapi.testFramework package and
tried to use it. The thing is that the default configuration will try to
load too many plugins (TomcatManger for instance) and it fails and I don't
want that. How do i configure an LightweightIdeaTestCase to not load all
the IDEA plugins ?. Another option would be to put all the plugins jar in
the classpath but it seems like a too big overhead just for simple language
PSI tests. Any help (i already looked around on the forums but i'm stuck) ?

Sincerely,
ToMiC


3 comments

Hello ToMiC,

The best documentation for the TestFramework currently available is:
http://kirblog.idetalk.com/2005/09/writing-unit-tests-for-intellij-idea.html

T> I want to run some unit tests to actually see how the language
T> lexer/parser
T> works in the context of IDEA but i don't want to pay the price of
T> starting/stopping
T> IDEA all the time.
T> I looked around and saw the com.intellij.openapi.testFramework
T> package and
T> tried to use it. The thing is that the default configuration will try
T> to
T> load too many plugins (TomcatManger for instance) and it fails and I
T> don't
T> want that. How do i configure an LightweightIdeaTestCase to not load
T> all
T> the IDEA plugins ?. Another option would be to put all the plugins
T> jar in
T> the classpath but it seems like a too big overhead just for simple
T> language
T> PSI tests. Any help (i already looked around on the forums but i'm
T> stuck) ?

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0

It starts .. but trying to parse one file ( PsiFile file = this.createFile("file.lang", "statement in the language;"); ) for my language fails (if I try with one java file it works).

Is there a way to specify which plugins to load or I have to hack it somehow ( aka simulate initComponent calls ) ?


0


Heh .. found out how by simulating initComponent call.

It starts .. but trying to parse one file ( PsiFile file =
this.createFile("file.lang", "statement in the language;"); ) for my
language fails (if I try with one java file it works).

Is there a way to specify which plugins to load or I have to hack it
somehow ( aka simulate initComponent calls ) ?



0

Please sign in to leave a comment.