scheglov / google-plugin-for-eclipse

Automatically exported from code.google.com/p/google-plugin-for-eclipse
Eclipse Public License 1.0
0 stars 3 forks source link

Debug Tycho/Surefire test failures in com.google.gwt.eclipse.core.test #329

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
There are two tests that were failing in GWTRuntimeTest both when run under 
Tycho and from the PDE. Those are both disabled.

There are 15 other failures only when run under Tycho/Surefire, all occurring 
when JavaUI.openInEditor() unexpectedly returns a null IEditorPart. After a 
couple of hours of printf debugging I found the following:
* Good ICompilationUnit objects are retrieved, backed by good underlying 
resources.
* The Platform reports it is initialized, and adding delays and waiting for 
jobs to go idle do not fix the problem.
* EditorUtility.getEditorInput(iCompilationUnit) succeeds
* EditorUtility.getEditorDescription returns a type 
org.eclipse.jdt.ui.CompilationUnitEditor

I tried both IDE.openEditor() and JavaUI.openInEditor() but never figured out 
the missing configuration required to get the tests to succeed, so I updated 
the pom.xml file to exclude the following 3 files:
JsniFormattingUtilTest.java
JsniMethodBodyCompletionProposalComputerTest.java
JavaComplilationParticipantTest.java

Original issue reported on code.google.com by tpar...@google.com on 11 Feb 2015 at 7:53

GoogleCodeExporter commented 9 years ago
JavaQueryParticipantTest is now also failing consistently with the following 
stack trace:

JavaQueryParticipantTest.testParamTypeSearch()
org.eclipse.swt.SWTException: Failed to execute runnable 
(org.eclipse.e4.core.di.InjectionException: java.lang.NullPointerException)
        at org.eclipse.swt.SWT.error(SWT.java:4441)
        at org.eclipse.swt.SWT.error(SWT.java:4356)
        at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:139)
        at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3774)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3412)
        at com.google.gdt.eclipse.core.SWTUtilities.delay(SWTUtilities.java:130)
        at com.google.gdt.eclipse.core.jobs.JobsUtilities.waitForIdle(JobsUtilities.java:37)
        at com.google.gwt.eclipse.core.test.AbstractGWTPluginTestCase.createTestProject(AbstractGWTPluginTestCase.java:275)
        at com.google.gwt.eclipse.core.test.AbstractGWTPluginTestCase.setUp(AbstractGWTPluginTestCase.java:229)
        at junit.framework.TestCase.runBare(TestCase.java:139)
Caused by: java.lang.NullPointerException: null
        at org.eclipse.ui.internal.WorkbenchPage.setPerspective(WorkbenchPage.java:4061)
        at org.eclipse.ui.internal.WorkbenchWindow.setup(WorkbenchWindow.java:733)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
        at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:888)
        at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:120)
        at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:85)
        at org.eclipse.e4.core.contexts.ContextInjectionFactory.inject(ContextInjectionFactory.java:73)
        at org.eclipse.ui.internal.Workbench.createWorkbenchWindow(Workbench.java:1480)
        at org.eclipse.ui.internal.Workbench.getActiveWorkbenchWindow(Workbench.java:1453)
        at com.google.gdt.eclipse.suite.GdtPlugin.maybeAddNewWizardActionsToWorkbench(GdtPlugin.java:317)
        at com.google.gdt.eclipse.suite.GdtPlugin.access$3(GdtPlugin.java:313)
        at com.google.gdt.eclipse.suite.GdtPlugin$4.run(GdtPlugin.java:343)
        at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
        at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)
        at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3774)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3412)
        at com.google.gdt.eclipse.core.SWTUtilities.delay(SWTUtilities.java:130)
        at com.google.gdt.eclipse.core.jobs.JobsUtilities.waitForIdle(JobsUtilities.java:37)
        at com.google.gwt.eclipse.core.test.AbstractGWTPluginTestCase.createTestProject(AbstractGWTPluginTestCase.java:275)
        at com.google.gwt.eclipse.core.test.AbstractGWTPluginTestCase.setUp(AbstractGWTPluginTestCase.java:229)
        at junit.framework.TestCase.runBare(TestCase.java:139)

That trace is similar to one I saw consitently in some already-disabled SWTBot 
tests, that WorkbenchPage.setPerspective() fails with an NPE.

Original comment by tpar...@google.com on 13 Feb 2015 at 1:26