Problem using test fixtures - CORE_PLUGIN_ID not registered with IC

Hi all,

I'm developing using IC-90.96, and my tests no longer work. I'm using the following code to set up a test fixture:

myFixture = createFixture();

try
{
  myFixture.setUp();
}
catch (Exception e)
{
  throw new Error(e);
}


protected IdeaProjectTestFixture createFixture()
{
  TestFixtureBuilder<IdeaProjectTestFixture> fixtureBuilder =
    IdeaTestFixtureFactory.getFixtureFactory().createLightFixtureBuilder();
  return fixtureBuilder.getFixture();
}


When I call setUp(), I get the following exception:

java.lang.AssertionError
    at com.intellij.ide.plugins.PluginManager.initializePlugins(PluginManager.java:200)
    at com.intellij.ide.plugins.PluginManager.getPlugins(PluginManager.java:103)
    at com.intellij.openapi.application.impl.ApplicationImpl.loadApplicationComponents(ApplicationImpl.java:296)
    at com.intellij.openapi.application.impl.ApplicationImpl.<init>(ApplicationImpl.java:191)
    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.LightPlatformTestCase.initApplication(LightPlatformTestCase.java:136)
    at com.intellij.testFramework.fixtures.impl.LightIdeaTestFixtureImpl.setUp(LightIdeaTestFixtureImpl.java:47)
    at org.jetbrains.plugins.scheme.parser.ParserTestBase.setUp(ParserTestBase.java:35)


It seems to be assuming that a plugin with ID CORE_PLUGIN_ID is registered. Any ideas what I could do to fix this?

Thanks,
Colin

2 comments
Comment actions Permalink

Hello Colin,

For the time being, you need to add -Didea.platform.prefix=Idea when you're
running your tests against an IC build of IDEA. In the future that option
will be set automatically.

I'm developing using IC-90.96, and my tests no longer work. I'm using
the following code to set up a test fixture:

myFixture = createFixture();

try
{
myFixture.setUp();
}
catch (Exception e)
{
throw new Error(e);
}
protected IdeaProjectTestFixture createFixture()
{
TestFixtureBuilder<IdeaProjectTestFixture> fixtureBuilder =

IdeaTestFixtureFactory.getFixtureFactory().createLightFixtureBuilder()
;
return fixtureBuilder.getFixture();
}
When I call setUp(), I get the following exception:

java.lang.AssertionError
at
com.intellij.ide.plugins.PluginManager.initializePlugins(PluginManager
.java:200)
at
com.intellij.ide.plugins.PluginManager.getPlugins(PluginManager.java:1
03)
at
com.intellij.openapi.application.impl.ApplicationImpl.loadApplicationC
omponents(ApplicationImpl.java:296)
at
com.intellij.openapi.application.impl.ApplicationImpl.<init>(Applicati
onImpl.java:191)
at
com.intellij.openapi.application.ex.ApplicationManagerEx.createApplica
tion(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.LightPlatformTestCase.initApplication(Light
PlatformTestCase.java:136)
at
com.intellij.testFramework.fixtures.impl.LightIdeaTestFixtureImpl.setU
p(LightIdeaTestFixtureImpl.java:47)
at
org.jetbrains.plugins.scheme.parser.ParserTestBase.setUp(ParserTestBas
e.java:35)
It seems to be assuming that a plugin with ID CORE_PLUGIN_ID is
registered. Any ideas what I could do to fix this?

Thanks,
Colin
---
Original message URL:
http://www.jetbrains.net/devnet/message/5247953#5247953

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Hi Dmitry,

Ok, thanks. I'll try that this evening and see how I go.

Cheers,
Colin

0

Please sign in to leave a comment.