How to load a plugin during execution of unittests - IdeaTestCase.

Hi,

I am working on a custom plugin which extends Python plugin. The IdeaTestCase written for the plugin are failing as PythonId plugin is not loaded during tests execution. Can you tell me how to load a plugin (in this case PythonId) during execution of IdeaTestCase? As PythonId plugin depends on yaml plugin - does this also gets loaded automatically or do I need to do something to load yaml plugin also?

Thanks
Chandra

4 comments
Comment actions Permalink

do you have Python plugin defined as < depends >
in your own plugin.xml? did you set -Didea.home.path to point to your IDEA sources?

0
Comment actions Permalink

Yes, python plugin is defined as <depends> .. in my plugin.xml.
Does order of idea.plugins.path matter? python.jar comes before yaml.jar, I think this should be fine.

Here is the stack trace:

Plugin "MyPlugin" was not loaded: required plugin "Pythonid" not installed.:
    at IntellijTestSuite$1.processError(IntellijTestSuite.java:138)
    at com.intellij.testFramework.TestLogger.error(TestLogger.java:46)
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:48)
    at com.intellij.ide.plugins.PluginManager.prepareLoadingPluginsErrorMessage(PluginManager.java:273)
    at com.intellij.ide.plugins.PluginManager.initializePlugins(PluginManager.java:192)
    at com.intellij.ide.plugins.PluginManager.getPlugins(PluginManager.java:103)
    at com.intellij.openapi.application.impl.ApplicationImpl.loadApplicationComponents(ApplicationImpl.java:289)
    at com.intellij.openapi.application.impl.ApplicationImpl.<init>(ApplicationImpl.java:192)
    at com.intellij.openapi.application.ex.ApplicationManagerEx.createApplication(ApplicationManagerEx.java:35)
    at com.intellij.idea.CommandLineApplication.<init>(CommandLineApplication.java:57)
    at com.intellij.idea.CommandLineApplication.<init>(CommandLineApplication.java:51)
    at com.intellij.idea.IdeaTestApplication.<init>(IdeaTestApplication.java:33)
    at com.intellij.idea.IdeaTestApplication.getInstance(IdeaTestApplication.java:56)
    at com.intellij.testFramework.PlatformTestCase.initApplication(PlatformTestCase.java:122)
    at com.intellij.testFramework.PlatformTestCase.setUp(PlatformTestCase.java:155)
    at MyPluginTest.setUp(MyPluginTest.java:)
    at com.intellij.testFramework.PlatformTestCase$4.run(PlatformTestCase.java:479)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:216)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:602)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)

0
Comment actions Permalink

did you add all required dependent plugins (and their dependents) to your IDEA JDK?

0
Comment actions Permalink

When I run the test from IDE, it works fine.
I am trying to run the test from command line by passing the flags (like: idea.plugins.path etc). The test fails during command line execution.

Is there a way to get more verbose error message from Idea? [Instead of just failed to install plugin PythonId]. I think, that helps in debugging the problem.

thanks,
chandra

0

Please sign in to leave a comment.