Skip to content

Fix vm settings for running javafx tests on windows vm's #257

@cal-pratt

Description

@cal-pratt

Making a separate issue for what I saw in #256 regarding the javafx tests.

The gradle build hangs forever at this test on my windows machine:

...
com.easternedgerobotics.rov.fx.ViewLoaderTest > loadViewDoesSetSceneRootNode FAILED
    java.lang.RuntimeException: java.lang.reflect.InvocationTargetException

        Caused by:
        java.lang.reflect.InvocationTargetException

            Caused by:
            java.lang.UnsupportedOperationException: Unable to open DISPLAY

And if I enable X11 in the Vagrantfile captain.ssh.forward_x11 = true I get these errors, but it doesn't hang:

...
com.easternedgerobotics.rov.fx.ViewLoaderTest > loadViewDoesSetSceneRootNode FAILED
    java.awt.AWTError: Can't connect to X11 window server using 'localhost:10.0' as the value of the DISPLAY variable.

com.easternedgerobotics.rov.fx.ViewLoaderTest > loadViewCreatesStage FAILED
    java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11.XToolkit

com.easternedgerobotics.rov.fx.ViewLoaderTest > loadViewDoesSetStageEventHandler FAILED
    java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11.XToolkit
...

Clearly something extra needs to be done to the Vagrantfile in windows such that X11 forwarding works (or possibly this lies in the ansible-playbook; not sure). Also note that in the second case, javafx is trying to load sun.awt.X11.XToolkit. I didn't think that sun libraries were even present in OpenJDK and Open JavaFX seeing as those are proprietary Oracle libs. Maybe fixing the X11 forwarding will solve this error as well.... 👻

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions