plugin test
I tried to write a simple plugin test that extends from LightCodeInsightFixtureTestCase following the example here :
https://www.jetbrains.org/intellij/sdk/docs/basics/testing_plugins/light_and_heavy_tests.html
But i run into "java.lang.NoSuchMethodError: org.apache.log4j.WriterAppender.<init>(Lorg/apache/log4j/Layout;Ljava/io/Writer;"
I tried resolving this by following a suggestion here https://stackoverflow.com/questions/23499537/java-lang-nosuchmethoderror-org-apache-log4j-logger
but was not of much help.
I am using Junit5 for the other unit tests and wanted to write some 'headless' tests. How can i get around NoSuchMethodError?
Thanks in advance!!!
请先登录再写评论。
IIRC, this happens because log4j, while being shipped with IDEA, isn't added to the plugin SDK's classpath by default. Open the project structure dialog (File -> Project Structure... -> SDKs [left panel] -> {your SDK name} [mid panel] -> ClassPath [right panel]) and add .../lib/log4j.jar (and, I think, netty-all-4.1.10.Final.jar). If in doubt, just add all of the shipped jars.
Issue is fixed, tysm!