Continuous integration – how do I test JavaFX 2 in a headless environment?

I tried to automatically test JavaFX 2 applications running on Java 7u6 through integrated JavaFX 2.2

As a next step, I want to run tests as part of the continuous deployment process Since the current CI server runs on openSUSE, which is not officially supported by JavaFX, I have installed Ubuntu server in the virtual machine and GTK2 In order to make up for the lack of a fully open window system, I have tried to run tests on xvnc and xvfb, but to no avail

On xvnc, the test failed

Prism ES2 Error - nInitialize: glXChooseFBConfig Failed

And in xvfb, they gave it to me

Xlib:  extension "RANDR" missing on display ":10".

A blog post suggests installing GTK engines pixbuf to alleviate the second problem, but this will only change the number of displays in the error message

Now, I summon JavaFX's knowledge of stackoverflow and ask

>Do you know how to solve the above error? > Have you successfully run JavaFX 2 tests or robot interactions on the (headless) CI server? > How do you configure the system to work properly?

Solution

JavaFX 8 supports (headless) CI server testing

Answer according to the information in these JavaFX question tracking records:

>Jdk-8088651 "headless glass kit needs to be connected to quantum and prism unit test" > jdk-8091286 "headless and headache test")

Updated January 8, 2015

The linked JavaFX issue tracking record is not implemented for Java 8 and has been reassigned to Java 9

The Java 8 source code currently includes a minimal rendering engine called monocle, which provides headless rendering for JavaFX components (and rendering for various other target platforms) I have never used monocle and cannot provide detailed instructions on how to use it for headless rendering I believe that with monocle, you currently need to perform custom builds of JavaFX from source code (because I think monocle is usually only released in the embedded JavaFX version, which is not the standard JavaFX version attached to the desktop Java runtime and JDK environment)

Information about monocle is available on the JavaFX wiki

Although monocle provides headless rendering, I don't think that using monocle to perform headless rendering is officially supported by Oracle (although I don't think any form of JavaFX headless rendering is officially supported, so I think if monocle works well, you can use it for everything)

Headless rendering in monocle is a software rendering implementation, so the execution of some graphics primitives may be slower than the standard hardware acceleration of JavaFX in desktop environment

There may be other ways to allow JavaFX to run in an unrecognized headless environment

If in doubt, ask JavaFX developers on the openjfx dev mailing list

If you are running under Linux, Jan zarnikov's answer suggests that using xvfb may be a good solution and may be more suitable for using monocle

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>