Problem with Test Class and Fixture

Hi all,

I wrote a plugin for IntelliJ IDEA and now I want to test it. I tried to make test class for my DesignerEditorPanel like AndroidDesignerEditorPanelTest but I got the error. Next I found this blog: https://confluence.jetbrains.com/display/IntelliJIDEA/Completion+Test and I tried to extend my class from LightCodeInsightFixtureTestCase but I got the same error.
Could you help me, please?

My test class:

public class MyDesignerEditorPanelTest extends LightCodeInsightFixtureTestCase {

    public void myTest() {
        System.out.println("Test message");
    
}
}

The errors:
log4j:WARN No appenders could be found for logger (#com.intellij.openapi.util.io.ZipFileCache).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

java.lang.UnsupportedClassVersionError: android/app/Application : Unsupported major.minor version 51.0
     at java.lang.ClassLoader.defineClass1(Native Method)
     at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
     at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
     at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
     at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
     at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
     at java.lang.Class.forName0(Native Method)
     at java.lang.Class.forName(Class.java:249)
     at io.netty.util.internal.PlatformDependent.isAndroid0(PlatformDependent.java:436)
     at io.netty.util.internal.PlatformDependent.<clinit>(PlatformDependent.java:61)
     at io.netty.channel.group.DefaultChannelGroup.<init>(DefaultChannelGroup.java:47)
     at io.netty.channel.group.DefaultChannelGroup.<init>(DefaultChannelGroup.java:61)
     at org.jetbrains.io.ChannelRegistrar.<init>(ChannelRegistrar.java:13)
     at com.intellij.compiler.server.BuildManager.<init>(BuildManager.java:212)
     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
     at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
     at org.picocontainer.defaults.InstantiatingComponentAdapter.newInstance(InstantiatingComponentAdapter.java:193)
     at org.picocontainer.defaults.ConstructorInjectionComponentAdapter$1.run(ConstructorInjectionComponentAdapter.java:220)
     at org.picocontainer.defaults.ThreadLocalCyclicDependencyGuard.observe(ThreadLocalCyclicDependencyGuard.java:53)
     at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getComponentInstance(ConstructorInjectionComponentAdapter.java:248)
     at com.intellij.util.pico.ConstructorInjectionComponentAdapter.getComponentInstance(ConstructorInjectionComponentAdapter.java:58)
     at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter$1.getComponentInstance(ComponentManagerImpl.java:550)
     at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:610)
     at com.intellij.util.pico.DefaultPicoContainer.getLocalInstance(DefaultPicoContainer.java:245)
     at com.intellij.util.pico.DefaultPicoContainer.getComponentInstance(DefaultPicoContainer.java:211)
     at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponent(ComponentManagerImpl.java:125)
     at com.intellij.openapi.application.impl.ApplicationImpl.createComponent(ApplicationImpl.java:359)
     at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponents(ComponentManagerImpl.java:116)
     at com.intellij.openapi.components.impl.ComponentManagerImpl.init(ComponentManagerImpl.java:87)
     at com.intellij.openapi.components.impl.stores.ApplicationStoreImpl.load(ApplicationStoreImpl.java:101)
     at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:504)
     at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:486)
     at com.intellij.idea.IdeaTestApplication$1.run(IdeaTestApplication.java:56)
     at com.intellij.openapi.application.RunResult.run(RunResult.java:38)
     at com.intellij.openapi.application.WriteAction$1$1.run(WriteAction.java:47)
     at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:937)
     at com.intellij.openapi.application.WriteAction$1.run(WriteAction.java:44)
     at com.intellij.openapi.application.WriteAction.execute(WriteAction.java:53)
     at com.intellij.idea.IdeaTestApplication.getInstance(IdeaTestApplication.java:53)
     at com.intellij.testFramework.LightPlatformTestCase.initApplication(LightPlatformTestCase.java:167)
     at com.intellij.testFramework.fixtures.impl.LightIdeaTestFixtureImpl.setUp(LightIdeaTestFixtureImpl.java:50)
     at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl$21.run(CodeInsightTestFixtureImpl.java:1216)
     at com.intellij.util.ui.UIUtil.invokeAndWaitIfNeeded(UIUtil.java:2398)
     at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.setUp(CodeInsightTestFixtureImpl.java:1212)
     at com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase.setUp(LightCodeInsightFixtureTestCase.java:100)
     at com.intellij.testFramework.UsefulTestCase.defaultRunBare(UsefulTestCase.java:341)
     at com.intellij.testFramework.UsefulTestCase$4.run(UsefulTestCase.java:428)
     at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
     at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
     at java.awt.EventQueue.access$400(EventQueue.java:82)
     at java.awt.EventQueue$2.run(EventQueue.java:676)
     at java.awt.EventQueue$2.run(EventQueue.java:674)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
     at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:362)
     at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
     at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

ERROR: Could not initialize class io.netty.util.internal.PlatformDependent
java.lang.NoClassDefFoundError: Could not initialize class io.netty.util.internal.PlatformDependent
     at io.netty.channel.group.DefaultChannelGroup.<init>(DefaultChannelGroup.java:47)
     at io.netty.channel.group.DefaultChannelGroup.<init>(DefaultChannelGroup.java:61)
     at org.jetbrains.io.ChannelRegistrar.<init>(ChannelRegistrar.java:13)
     at org.jetbrains.io.BuiltInServer.<init>(BuiltInServer.java:45)
     at org.jetbrains.ide.BuiltInServerManagerImpl$1.run(BuiltInServerManagerImpl.java:91)
     at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:405)
     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
     at java.util.concurrent.FutureTask.run(FutureTask.java:138)
     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
     at java.lang.Thread.run(Thread.java:695)
     at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:56)
ERROR: Memory leak detected: com.intellij.codeInsight.preview.ImageOrColorPreviewManager@62ad4bb0 of class class com.intellij.codeInsight.preview.ImageOrColorPreviewManager
See the cause for the corresponding Disposer.register() stacktrace:

java.lang.RuntimeException: Memory leak detected: com.intellij.codeInsight.preview.ImageOrColorPreviewManager@62ad4bb0 of class class com.intellij.codeInsight.preview.ImageOrColorPreviewManager
See the cause for the corresponding Disposer.register() stacktrace:

     at com.intellij.openapi.util.objectTree.ObjectTree.assertIsEmpty(ObjectTree.java:209)
     at com.intellij.openapi.util.Disposer.assertIsEmpty(Disposer.java:125)
     at com.intellij.openapi.util.Disposer.assertIsEmpty(Disposer.java:121)
     at com.intellij.openapi.application.impl.ApplicationImpl.disposeSelf(ApplicationImpl.java:328)
     at com.intellij.openapi.application.impl.ApplicationImpl.access$400(ApplicationImpl.java:87)
     at com.intellij.openapi.application.impl.ApplicationImpl$5$1.run(ApplicationImpl.java:288)
     at com.intellij.openapi.util.ShutDownTracker$2.run(ShutDownTracker.java:171)
     at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
     at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
     at java.awt.EventQueue.access$400(EventQueue.java:82)
     at java.awt.EventQueue$2.run(EventQueue.java:676)
     at java.awt.EventQueue$2.run(EventQueue.java:674)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
     at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:734)
     at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:569)
     at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:382)
     at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
     at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.Throwable
     at com.intellij.openapi.util.objectTree.ObjectTree.getOrCreateNodeFor(ObjectTree.java:101)
     at com.intellij.openapi.util.objectTree.ObjectTree.register(ObjectTree.java:62)
     at com.intellij.openapi.util.Disposer.register(Disposer.java:81)
     at com.intellij.openapi.util.Disposer.register(Disposer.java:75)
     at com.intellij.util.EventDispatcher.addListener(EventDispatcher.java:116)
     at com.intellij.openapi.editor.impl.EditorFactoryImpl.addEditorFactoryListener(EditorFactoryImpl.java:256)
     at com.intellij.codeInsight.preview.ImageOrColorPreviewManager.<init>(ImageOrColorPreviewManager.java:68)
     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
     at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
     at org.picocontainer.defaults.InstantiatingComponentAdapter.newInstance(InstantiatingComponentAdapter.java:193)
     at org.picocontainer.defaults.ConstructorInjectionComponentAdapter$1.run(ConstructorInjectionComponentAdapter.java:220)
     at org.picocontainer.defaults.ThreadLocalCyclicDependencyGuard.observe(ThreadLocalCyclicDependencyGuard.java:53)
     at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getComponentInstance(ConstructorInjectionComponentAdapter.java:248)
     at com.intellij.util.pico.ConstructorInjectionComponentAdapter.getComponentInstance(ConstructorInjectionComponentAdapter.java:58)
     at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter$1.getComponentInstance(ComponentManagerImpl.java:550)
     at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:610)
     at com.intellij.util.pico.DefaultPicoContainer.getLocalInstance(DefaultPicoContainer.java:245)
     at com.intellij.util.pico.DefaultPicoContainer.getComponentInstance(DefaultPicoContainer.java:211)
     at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponent(ComponentManagerImpl.java:125)
     at com.intellij.openapi.application.impl.ApplicationImpl.createComponent(ApplicationImpl.java:359)
     at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponents(ComponentManagerImpl.java:116)
     at com.intellij.openapi.components.impl.ComponentManagerImpl.init(ComponentManagerImpl.java:87)
     at com.intellij.openapi.components.impl.stores.ApplicationStoreImpl.load(ApplicationStoreImpl.java:101)
     at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:504)
     at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:486)
     at com.intellij.idea.IdeaTestApplication$1.run(IdeaTestApplication.java:56)
     at com.intellij.openapi.application.RunResult.run(RunResult.java:38)
     at com.intellij.openapi.application.WriteAction$1$1.run(WriteAction.java:47)
     at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:937)
     at com.intellij.openapi.application.WriteAction$1.run(WriteAction.java:44)
     at com.intellij.openapi.application.WriteAction.execute(WriteAction.java:53)
     at com.intellij.idea.IdeaTestApplication.getInstance(IdeaTestApplication.java:53)
     at com.intellij.testFramework.LightPlatformTestCase.initApplication(LightPlatformTestCase.java:167)
     at com.intellij.testFramework.fixtures.impl.LightIdeaTestFixtureImpl.setUp(LightIdeaTestFixtureImpl.java:50)
     at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl$21.run(CodeInsightTestFixtureImpl.java:1216)
     at com.intellij.util.ui.UIUtil.invokeAndWaitIfNeeded(UIUtil.java:2398)
     at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.setUp(CodeInsightTestFixtureImpl.java:1212)
     at com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase.setUp(LightCodeInsightFixtureTestCase.java:100)
     at com.intellij.testFramework.UsefulTestCase.defaultRunBare(UsefulTestCase.java:341)
     at com.intellij.testFramework.UsefulTestCase$4.run(UsefulTestCase.java:428)
     at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
     at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
     at java.awt.EventQueue.access$400(EventQueue.java:82)
     at java.awt.EventQueue$2.run(EventQueue.java:676)
     at java.awt.EventQueue$2.run(EventQueue.java:674)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
     at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:362)
     ... 6 more
ERROR: Memory leak detected: com.intellij.codeInsight.preview.ImageOrColorPreviewManager@62ad4bb0 of class class com.intellij.codeInsight.preview.ImageOrColorPreviewManager
See the cause for the corresponding Disposer.register() stacktrace:

java.lang.AssertionError: Memory leak detected: com.intellij.codeInsight.preview.ImageOrColorPreviewManager@62ad4bb0 of class class com.intellij.codeInsight.preview.ImageOrColorPreviewManager
See the cause for the corresponding Disposer.register() stacktrace:

     at com.intellij.testFramework.LoggedErrorProcessor.processError(LoggedErrorProcessor.java:56)
     at com.intellij.testFramework.TestLogger.error(TestLogger.java:67)
     at com.intellij.openapi.diagnostic.Logger.error(Logger.java:134)
     at com.intellij.openapi.util.objectTree.ObjectTree.assertIsEmpty(ObjectTree.java:215)
     at com.intellij.openapi.util.Disposer.assertIsEmpty(Disposer.java:125)
     at com.intellij.openapi.util.Disposer.assertIsEmpty(Disposer.java:121)
     at com.intellij.openapi.application.impl.ApplicationImpl.disposeSelf(ApplicationImpl.java:328)
     at com.intellij.openapi.application.impl.ApplicationImpl.access$400(ApplicationImpl.java:87)
     at com.intellij.openapi.application.impl.ApplicationImpl$5$1.run(ApplicationImpl.java:288)
     at com.intellij.openapi.util.ShutDownTracker$2.run(ShutDownTracker.java:171)
     at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
     at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
     at java.awt.EventQueue.access$400(EventQueue.java:82)
     at java.awt.EventQueue$2.run(EventQueue.java:676)
     at java.awt.EventQueue$2.run(EventQueue.java:674)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
     at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:734)
     at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:569)
     at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:382)
     at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
     at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
ERROR: Memory leak detected: com.intellij.codeInsight.preview.ImageOrColorPreviewManager@62ad4bb0 of class class com.intellij.codeInsight.preview.ImageOrColorPreviewManager
See the cause for the corresponding Disposer.register() stacktrace:

java.lang.AssertionError: Memory leak detected: com.intellij.codeInsight.preview.ImageOrColorPreviewManager@62ad4bb0 of class class com.intellij.codeInsight.preview.ImageOrColorPreviewManager
See the cause for the corresponding Disposer.register() stacktrace:

     at com.intellij.testFramework.LoggedErrorProcessor.processError(LoggedErrorProcessor.java:56)
     at com.intellij.testFramework.TestLogger.error(TestLogger.java:67)
     at com.intellij.openapi.diagnostic.Logger.error(Logger.java:134)
     at com.intellij.ide.plugins.PluginManager.processException(PluginManager.java:134)
     at com.intellij.ide.IdeEventQueue.processException(IdeEventQueue.java:403)
     at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:737)
     at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:569)
     at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:382)
     at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
     at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Process finished with exit code 255
1 comment
Comment actions Permalink

Please make sure that you use JDK 7 to run your tests.


0

Please sign in to leave a comment.