Can't setUp test case ...

I'm trying to run very simple test case (CE-9.0.2).

Here is example:

public class BaseIntellijTestCase extends LightCodeInsightTestCase {

    static { //Crazy code...
        System.setProperty("idea.plugins.load", "false");
//        System.setProperty("idea.plugins.path", PathManager.getPreinstalledPluginsPath());


        ExtensionsArea extensionsArea = Extensions.getRootArea();
        extensionsArea.registerExtensionPoint("com.intellij.ApplicationLoadListener", "org.sse.graphview.intellij.BullShit");
        extensionsArea.registerExtensionPoint("com.intellij.ComponentRoamingType", "com.intellij.openapi.components.impl.stores.RoamingTypeExtensionPointBean");

        }



    public void testOk() { //Actual test case...
        assertEmpty("");
    }
}


class BullShit implements ApplicationLoadListener {

    public void beforeApplicationLoaded(Application application) {
        System.out.println("beforeApplicationLoaded: " + application);
    }
}


If without static block I got error:

java.lang.NullPointerException
    at com.intellij.ide.plugins.IdeaPluginDescriptorImpl.insertDependency(IdeaPluginDescriptorImpl.java:508)
    at com.intellij.ide.plugins.PluginManager.initializePlugins(PluginManager.java:203)
    at com.intellij.ide.plugins.PluginManager.getPlugins(PluginManager.java:103)
    at com.intellij.openapi.application.impl.ApplicationImpl.loadApplicationComponents(ApplicationImpl.java:290)
    at com.intellij.openapi.application.impl.ApplicationImpl.<init>(ApplicationImpl.java:193)
    at com.intellij.openapi.application.ex.ApplicationManagerEx.createApplication(ApplicationManagerEx.java:35)


If plugins.load == false (or line with idea.plugins.path is uncommented), then this NPE is replaced by another exception:

java.lang.IllegalArgumentException: Missing extension point: com.intellij.ApplicationLoadListener in area null
    at com.intellij.openapi.extensions.impl.ExtensionsAreaImpl.getExtensionPoint(ExtensionsAreaImpl.java:361)
    at com.intellij.openapi.extensions.impl.ExtensionsAreaImpl.getExtensionPoint(ExtensionsAreaImpl.java:37)
    at com.intellij.openapi.application.impl.ApplicationImpl.fireBeforeApplicationLoaded(ApplicationImpl.java:420)
    at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:377)



If I fix it (see static block), I get one more exception:

java.lang.NullPointerException
    at com.intellij.testFramework.LightPlatformTestCase.cleanPersistedVFSContent(LightPlatformTestCase.java:163)
    at com.intellij.testFramework.LightPlatformTestCase.access$000(LightPlatformTestCase.java:98)
    at com.intellij.testFramework.LightPlatformTestCase$1.run(LightPlatformTestCase.java:176)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:752)
    at com.intellij.testFramework.LightPlatformTestCase.initProject(LightPlatformTestCase.java:169)
    at com.intellij.testFramework.LightPlatformTestCase.doSetup(LightPlatformTestCase.java:298)
    at com.intellij.testFramework.LightPlatformTestCase.setUp(LightPlatformTestCase.java:284)


... and I don't know how to fix it.

The same exceptions appears if I trying to use ParserTest from Clojure sources.

It looks like smth wrong in my local env. What should I do to run my amazing test case?

Thnx  a lot.

Please sign in to leave a comment.