Fail to run comparingReferences test case in the samples

Hi,

  I tried to run the TestThisPlugin test case in comparingReferences sample plugins and got the following exception. I think my plugin environment had been setup correctly. Any idea?

details:
Current thread: Thread[main,5,main] 1320566270
Our dispatch thread:Thread[AWT-EventQueue-0 11.1.2#IC-117.418, eap:false 11.1.2#IC-117.418, eap:false,6,main] 1422304160
SystemEventQueueThread: Thread[AWT-EventQueue-0 11.1.2#IC-117.418, eap:false 11.1.2#IC-117.418, eap:false,6,main] 1422304160
ERROR: Access is allowed from event dispatch thread only.
java.lang.Throwable
 at com.intellij.openapi.diagnostic.Logger.error(Logger.java:61)
 at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:989)
 at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:973)
 at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl.reloadScopes(DaemonCodeAnalyzerImpl.java:335)
 at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl.projectOpened(DaemonCodeAnalyzerImpl.java:305)
 at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl.prepareForTest(DaemonCodeAnalyzerImpl.java:261)
 at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.setUp(CodeInsightTestFixtureImpl.java:1048)
 at testPlugin.TestThisPlugin.setUp(TestThisPlugin.java:37)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
 at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
 at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
 at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
 at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
 at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
 at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
 at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
 at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76)
 at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
 at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
ERROR: Write access is allowed from event dispatch thread only
java.lang.Throwable
 at com.intellij.openapi.diagnostic.Logger.error(Logger.java:61)
 at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:989)
 at com.intellij.openapi.application.impl.ApplicationImpl.assertCanRunWriteAction(ApplicationImpl.java:969)
 at com.intellij.openapi.application.impl.ApplicationImpl.access$1000(ApplicationImpl.java:85)
 at com.intellij.openapi.application.impl.ApplicationImpl$WriteAccessToken.<init>(ApplicationImpl.java:1119)
 at com.intellij.openapi.application.impl.ApplicationImpl.acquireWriteActionLock(ApplicationImpl.java:1111)
 at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:900)
 at com.intellij.testFramework.UsefulTestCase$5.run(UsefulTestCase.java:642)
 at com.intellij.openapi.command.impl.CommandProcessorImpl.runUndoTransparentAction(CommandProcessorImpl.java:295)
 at com.intellij.testFramework.UsefulTestCase.doPostponedFormatting(UsefulTestCase.java:639)
 at com.intellij.testFramework.LightPlatformTestCase.doTearDown(LightPlatformTestCase.java:481)
 at com.intellij.testFramework.fixtures.impl.HeavyIdeaTestFixtureImpl.tearDown(HeavyIdeaTestFixtureImpl.java:109)
 at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.tearDown(CodeInsightTestFixtureImpl.java:1076)
 at com.intellij.testFramework.fixtures.impl.JavaCodeInsightTestFixtureImpl.tearDown(JavaCodeInsightTestFixtureImpl.java:96)
 at testPlugin.TestThisPlugin.tearDown(TestThisPlugin.java:44)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
 at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
 at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
 at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:36)
 at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
 at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
 at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
 at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76)
 at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
 at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
ERROR: Access is allowed from event dispatch thread only.
java.lang.Throwable
 at com.intellij.openapi.diagnostic.Logger.error(Logger.java:61)
 at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:989)
 at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:973)
 at com.intellij.codeInsight.completion.impl.CompletionServiceImpl.setCompletionPhase(CompletionServiceImpl.java:213)
 at com.intellij.codeInsight.completion.CompletionProgressIndicator.cleanupForNextTest(CompletionProgressIndicator.java:464)
 at com.intellij.testFramework.LightPlatformTestCase.doTearDown(LightPlatformTestCase.java:547)
 at com.intellij.testFramework.fixtures.impl.HeavyIdeaTestFixtureImpl.tearDown(HeavyIdeaTestFixtureImpl.java:109)
 at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.tearDown(CodeInsightTestFixtureImpl.java:1076)
 at com.intellij.testFramework.fixtures.impl.JavaCodeInsightTestFixtureImpl.tearDown(JavaCodeInsightTestFixtureImpl.java:96)
 at testPlugin.TestThisPlugin.tearDown(TestThisPlugin.java:44)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
 at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
 at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
 at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:36)
 at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
 at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
 at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
 at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76)
 at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
 at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
details:
Current thread: Thread[main,5,main] 1320566270
Our dispatch thread:Thread[AWT-EventQueue-0 11.1.2#IC-117.418, eap:false 11.1.2#IC-117.418, eap:false,6,main] 1422304160
SystemEventQueueThread: Thread[AWT-EventQueue-0 11.1.2#IC-117.418, eap:false 11.1.2#IC-117.418, eap:false,6,main] 1422304160
details:
Current thread: Thread[main,5,main] 1320566270
Our dispatch thread:Thread[AWT-EventQueue-0 11.1.2#IC-117.418, eap:false 11.1.2#IC-117.418, eap:false,6,main] 1422304160
SystemEventQueueThread: Thread[AWT-EventQueue-0 11.1.2#IC-117.418, eap:false 11.1.2#IC-117.418, eap:false,6,main] 1422304160

java.lang.AssertionError: Access is allowed from event dispatch thread only.
 at com.intellij.openapi.diagnostic.DefaultLogger.error(DefaultLogger.java:50)
 at com.intellij.openapi.diagnostic.Logger.error(Logger.java:61)
 at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:989)
 at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:973)
 at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl.reloadScopes(DaemonCodeAnalyzerImpl.java:335)
 at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl.projectOpened(DaemonCodeAnalyzerImpl.java:305)
 at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl.prepareForTest(DaemonCodeAnalyzerImpl.java:261)
 at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.setUp(CodeInsightTestFixtureImpl.java:1048)
 at testPlugin.TestThisPlugin.setUp(TestThisPlugin.java:37)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
 at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
 at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
 at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
 at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
 at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
 at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
 at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
 at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76)
 at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
 at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)


java.lang.AssertionError: Access is allowed from event dispatch thread only.
 at com.intellij.openapi.diagnostic.DefaultLogger.error(DefaultLogger.java:50)
 at com.intellij.openapi.diagnostic.Logger.error(Logger.java:61)
 at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:989)
 at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:973)
 at com.intellij.codeInsight.completion.impl.CompletionServiceImpl.setCompletionPhase(CompletionServiceImpl.java:213)
 at com.intellij.codeInsight.completion.CompletionProgressIndicator.cleanupForNextTest(CompletionProgressIndicator.java:464)
 at com.intellij.testFramework.LightPlatformTestCase.doTearDown(LightPlatformTestCase.java:547)
 at com.intellij.testFramework.fixtures.impl.HeavyIdeaTestFixtureImpl.tearDown(HeavyIdeaTestFixtureImpl.java:109)
 at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.tearDown(CodeInsightTestFixtureImpl.java:1076)
 at com.intellij.testFramework.fixtures.impl.JavaCodeInsightTestFixtureImpl.tearDown(JavaCodeInsightTestFixtureImpl.java:96)
 at testPlugin.TestThisPlugin.tearDown(TestThisPlugin.java:44)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
 at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
 at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
 at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:36)
 at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
 at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
 at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
 at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76)
 at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
 at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)




Marvin
1 comment
Comment actions Permalink

Hello Marvin,

indeed, there seems to be a problem here.

You can make the test work by adding the following code snippets:

- make "TestThisPlugin" extend "com.intellij.testFramework.UsefulTestCase"
- add corresponding "super.setup()" / "super.tearDown()" calls

Please watch ticket http://youtrack.jetbrains.com/issue/IDEA-88071.

HTH,
Yann

0

Please sign in to leave a comment.