Running the tests (run.tests) of the Scala-Plugin itself gives errors

Hi,

after downloading the source code of the Idea Plugin and fixing a bug, I tried to run the test suite of the Scala plugin, but that doesn't seem to work, but instead each test fails with something similar to this:

Testsuite: org.jetbrains.plugins.scala.annotator.ApplicationAnnotatorTest
Tests run: 11, Failures: 1, Errors: 10, Time elapsed: 0.982 sec

Testcase: testEmpty took 0.937 sec
        FAILED
com.intellij not found
junit.framework.AssertionFailedError: com.intellij not found
        at com.intellij.ide.plugins.PluginManager.initializePlugins(PluginManager.java:220)
        at com.intellij.ide.plugins.PluginManager.getPlugins(PluginManager.java:109)
        at com.intellij.openapi.application.impl.ApplicationImpl.loadApplicationComponents(ApplicationImpl.java:340)
        at com.intellij.openapi.application.impl.ApplicationImpl.<init>(ApplicationImpl.java:201)
        at com.intellij.openapi.application.ex.ApplicationManagerEx.createApplication(ApplicationManagerEx.java:36)
        at com.intellij.idea.CommandLineApplication.<init>(CommandLineApplication.java:58)
        at com.intellij.idea.CommandLineApplication.<init>(CommandLineApplication.java:52)
        at com.intellij.idea.IdeaTestApplication.<init>(IdeaTestApplication.java:35)
        at com.intellij.idea.IdeaTestApplication.getInstance(IdeaTestApplication.java:58)
        at com.intellij.testFramework.fixtures.impl.HeavyIdeaTestFixtureImpl.initApplication(HeavyIdeaTestFixtureImpl.java:169)
        at com.intellij.testFramework.fixtures.impl.HeavyIdeaTestFixtureImpl.setUp(HeavyIdeaTestFixtureImpl.java:95)
        at org.jetbrains.plugins.scala.base.SimpleTestCase.setUp(SimpleTestCase.scala:18)

Testcase: testFine took 0.021 sec
        Caused an ERROR
null
java.lang.NullPointerException
        at com.intellij.openapi.command.WriteCommandAction.performWriteCommandAction(WriteCommandAction.java:118)
        at com.intellij.openapi.command.WriteCommandAction.access$000(WriteCommandAction.java:34)
        at com.intellij.openapi.command.WriteCommandAction$1.run(WriteCommandAction.java:73)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:642)
        at java.awt.EventQueue.access$000(EventQueue.java:85)
        at java.awt.EventQueue$1.run(EventQueue.java:603)
        at java.awt.EventQueue$1.run(EventQueue.java:601)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:612)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)



Seems like a classpath issue, any hint how to get it working or how to diagnose it further?
3 comments
Comment actions Permalink

Hi Johannes,

You need to add a few extra jars to the IDEA SDK.

http://devnet.jetbrains.net/message/5272160#5272160

I have these added at the moment:

  • jar:///Applications/IntelliJ IDEA 10.app/lib/idea.jar!/
  • jar:///Applications/IntelliJ IDEA 10.app/plugins/maven/lib/archetype-common-2.0-alpha-4-SNAPSHOT.jar!/
  • jar:///Applications/IntelliJ IDEA 10.app/plugins/maven/lib/commons-beanutils.jar!/
  • jar:///Applications/IntelliJ IDEA 10.app/plugins/maven/lib/lucene-core-2.3.0.jar!/
  • jar:///Applications/IntelliJ IDEA 10.app/plugins/maven/lib/maven.jar!/
  • jar:///Applications/IntelliJ IDEA 10.app/plugins/maven/lib/resources_en.jar!/
  • jar:///Applications/IntelliJ IDEA 10.app/plugins/maven/lib/mercury-artifact-1.0-alpha-6.jar!/
  • jar:///Applications/IntelliJ IDEA 10.app/plugins/maven/lib/nexus-indexer-1.2.3.jar!/
  • jar:///Applications/IntelliJ IDEA 10.app/plugins/properties/lib/properties.jar!/
  • jar:///Applications/IntelliJ IDEA 10.app/plugins/properties/lib/resources_en.jar!/
  • jar:///Applications/IntelliJ IDEA 10.app/plugins/maven/lib/classworlds-1.1.jar!/
  • jar:///Applications/IntelliJ IDEA 10.app/plugins/maven/lib/commons-logging-1.1.1.jar!/
  • jar:///Applications/IntelliJ IDEA 10.app/plugins/maven/lib/plexus-utils-1.5.5.jar!/
  • jar:///Applications/IntelliJ IDEA 10.app/plugins/maven/lib/maven-2.2.1-uber.jar!/
  • jar:///Applications/IntelliJ IDEA 10.app/plugins/maven-ext/lib/maven-ext.jar!/
  • jar:///Applications/IntelliJ IDEA 10.app/lib/guava-r06.jar!/
  • jar:///Applications/IntelliJ IDEA 10.app/plugins/IntelliLang/lib/IntelliLang.jar!/
  • jar:///Applications/IntelliJ IDEA 10.app/plugins/maven/lib/maven-facade-api.jar!/
  • jar:///Applications/IntelliJ IDEA 10.app/plugins/copyright/lib/copyright.jar!/
  • jar:///Applications/IntelliJ IDEA 10.app/lib/cglib-2.2.jar!/
  • jar:///Applications/IntelliJ IDEA 10.app/lib/automaton.jar!/


Some of these might are only be in the Ultimate Edition.

-jason

0
Comment actions Permalink

Thanks Jason, good to know.

Actually, what I tried to do (but obviously somehow missed to mention) was to run the test suite directly from ant with

ant run.tests

that's when the errors as reported before occurred (those exception where from the log files. There were others on the console). So, is running the tests from ant still supported? Is there anything I have to do to make it work other than adapting the scala.properties file? Or is it the problem that I'm trying to run the test against the community edition?

Johannes

0
Comment actions Permalink

I  run the tests in IDEA, but the official build still runs them through Ant. Not sure what the problem is.

0

Please sign in to leave a comment.