pmd-eclipse-plugin icon indicating copy to clipboard operation
pmd-eclipse-plugin copied to clipboard

2 Tests fail when build on os x

Open go2master opened this issue 3 years ago • 4 comments

Hello ! Two tests are testProjectBuildPath and testProjectBuildPathOutsideWorkspace. Build is successful after I comment the tests. Build is successful on my windows as well. Why ?

go2master avatar Mar 31 '22 14:03 go2master

Thanks for reporting. However, there is too less detail.... It doesn't seem to be a general problem though, since it works on the CI build (https://github.com/pmd/pmd-eclipse-plugin/actions).

Any change you could provide the full log?

adangel avatar Apr 01 '22 15:04 adangel

BUILD SUCCESS today with warning. 2022-04-02 08:04:37.318 java[48939:563764] *** WARNING: Method userSpaceScaleFactor in class NSWindow is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead. 2022-04-02 08:04:37.343 java[48939:563764] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead. java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.sourceforge.pmd.lang.ast.xpath.Attribute.getValue(Attribute.java:98) at net.sourceforge.pmd.lang.ast.xpath.Attribute.getStringValue(Attribute.java:110) at net.sourceforge.pmd.lang.ast.AbstractNode.appendElement(AbstractNode.java:444) at net.sourceforge.pmd.lang.ast.AbstractNode.appendElement(AbstractNode.java:448) at net.sourceforge.pmd.lang.ast.AbstractNode.appendElement(AbstractNode.java:448) at net.sourceforge.pmd.lang.ast.AbstractNode.getAsDocument(AbstractNode.java:424) at net.sourceforge.pmd.eclipse.runtime.writer.impl.AstWriterImpl.write(AstWriterImpl.java:33) at net.sourceforge.pmd.eclipse.ui.actions.PMDGenerateASTAction.generateAST(PMDGenerateASTAction.java:90) at net.sourceforge.pmd.eclipse.ui.actions.PMDGenerateASTAction.run(PMDGenerateASTAction.java:147) at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372) at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507) at net.sourceforge.pmd.eclipse.ui.actions.PMDGenerateASTAction.run(PMDGenerateASTAction.java:64) at net.sourceforge.pmd.eclipse.ui.actions.PMDGenerateASTActionTest$1.run(PMDGenerateASTActionTest.java:76) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3976) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3653) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:140) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:611) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124) at org.eclipse.tycho.surefire.osgibooter.UITestApplication.runApplication(UITestApplication.java:29) at org.eclipse.tycho.surefire.osgibooter.AbstractUITestApplication.run(AbstractUITestApplication.java:122) at org.eclipse.tycho.surefire.osgibooter.UITestApplication.start(UITestApplication.java:35) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591) at org.eclipse.equinox.launcher.Main.run(Main.java:1450) at org.eclipse.equinox.launcher.Main.main(Main.java:1426) Caused by: java.lang.NullPointerException at net.sourceforge.pmd.lang.java.ast.AbstractAnyTypeDeclaration.getBinaryName(AbstractAnyTypeDeclaration.java:53) ... 47 more If failed tests occur again, I will catch that detail. Thank you.

go2master avatar Apr 02 '22 00:04 go2master

FAIL again. build.log

go2master avatar Apr 04 '22 13:04 go2master

What if I ignore testProjectBuildPath and testProjectBuildPathOutsideWorkspace ?

go2master avatar Jul 21 '22 02:07 go2master

FYI - the tests fail, when the test workspace doesn't have any Java VM configured and can't build the project - in that case, the Java classes are not compiled and therefore typeresolution is failing.

adangel avatar Mar 24 '23 18:03 adangel

With the latest changes, this should not happen anymore.

Especially:

  • on macosx a default vm is configured using org.eclipse.jdt.launching.macosx: https://github.com/pmd/pmd-eclipse-plugin/blob/0daad64b59db69f6c290e61315a839108246a063/pom.xml#L499-L514
  • when setting up a test project, it will use the java version of the available jre: https://github.com/pmd/pmd-eclipse-plugin/blob/0daad64b59db69f6c290e61315a839108246a063/net.sourceforge.pmd.eclipse.plugin.test/src/main/java/net/sourceforge/pmd/eclipse/EclipseUtils.java#L228-L232

I'm closing this issue now. Feel free to reopen, if the problem is still present for you.

adangel avatar May 13 '23 18:05 adangel