Unit-Tests and JDK
The following code fails in my unit-tests, because getCanonicalText() returns "String" instead of "java.lang.String":
Calling com.intellij.testFramework.builders.JavaModuleFixtureBuilder#addJdk resolves this issue, but test run times increase massively. Do I really need to do this or is there some error with my test setup? I see Spring plugin uses the same code as above without explicitly adding a JDK for the tests.
Thanks,
Yann
Please sign in to leave a comment.
No hints?
On a sidenote: I don't get this working on my Mac (running Leopard),
doesn't work..
Hello Yann,
could there be a difference between compiled classes and source-only classes? In the latter one IDEA wouldn't know that "String something() { ... }" returns a java.lang.String without having the classes from a JDK, while for a compiled class the qualified names are known. Just a guess.
Sascha
Hi Sascha,
yes that's true, still I wonder why Spring-plugin doesn't need to setup a JDK for its tests using exactly the same piece of code I posted in my first message. So either there must be some hidden parameters to plugin run configuration or something else I missed..
Greetings,
Yann
answering myself (once again..)
using
instead of comparing the type-names did the trick