Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
688 views
in Technique[技术] by (71.8m points)

continuous integration - How to test JavaFX 2 in a headless environment?

I am trying to automate testing for a JavaFX 2 application running on Java 7u6 with the integrated JavaFX 2.2. To that end, I have built and integrated Jemmy3 and JemmyFX into my build environment. A simple smoke test runs on all relevant OSs.

As a next step, I want to run the 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 set up an Ubuntu Server installation in a virtual machine and installed gtk2.
To remedy the lack of a fully fledged windowing system, I have tried running the tests on both Xvnc and Xvfb, but to no avail.

On Xvnc, the tests fail with

Prism ES2 Error - nInitialize: glXChooseFBConfig failed

whereas on Xvfb, they give me

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

A blog post suggested to install gtk-engines-pixbuf to alleviate the second problem, but this only changed the number of the display in the error message.

Now, I summon the JavaFX knowledge of StackOverflow and ask

  • Do you know how to solve the above errors?
  • Did you successfully run a JavaFX 2 test or Robot interaction on a (headless) CI server?
  • How did you configure that system to get it to work?
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I had a similar problem - running JUnit tests in a headless environment with Maven.

We don't use JemmyFX. We have just very simple tests that use a JUnit Rule similar to this one: https://gist.github.com/andytill/3835914 (this is required for code that uses Platform.runLater(...))

Current version of JavaFX (supplied with JDK 1.7.0-21) seems to be working in Xvfb on Ubuntu 12.04 without a running Xserver:

  1. Xvfb :99
  2. DISPLAY=:99 mvn clean install

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...