The headless toolkit mentioned by David and Richard is one possible approach, and may be the best long term approach depending on what you are trying to test (e.g., it won't test rendering, but might be fine for most of your tests), but as Richard notes, it isn't there yet.

If you prefer not to wait for that, one possible solution would be to set up a Jenkinks slave to be headful (may need to be hooked up to a keyboard/mouse or a display). You could then take a look at the system tests in rt/tests/system for examples of how we run headful tests. I don't know how feasible this would be for you.

Still another option is to use the oft-maligned StubToolkit (it stubs out all of Quantum and Prism), which all of our tests in the graphics and controls modules in JavaFX use. This isn't distributed (see https://javafx-jira.kenai.com/browse/RT-35010), but can easily be built from source.

-- Kevin


Richard Bair wrote:
Hi Tom!

On Jan 4, 2014, at 12:57 PM, Tom Eugelink <t...@tbee.org> wrote:

I'm trying to run JavaFX UI tests using TestFX on a headless Jenkins server (Ubuntu / 
Debian). I've gotten to the point where the UI is actually started by Jenkins, but then 
the test fail with a "no suitable pipeline found". Any suggestions how to fix 
that?

This was one of my long-standing TODO items: have a “headless” glass that would 
allow us to run quantum / prism tests headless. However for running scene graph 
or UI control tests, you should be using the “StubToolkit” instead of 
QuantumToolkit. The StubToolkit is located in Graphics/src/test, so for using 
it for 3rd party tests (like JFXtras) you would need to jar up the classes 
produced during a test run of FX. Then just specify the stub toolkit via 
-Djavafx.toolkit=com.sun.javafx.pgstub.StubToolkit

Now, longer term I wanted to nuke the StubToolkit. If we had a headless Glass 
then we could test with Prism/Quantum directly instead of the stubs. But this 
isn’t straightforward so it hasn’t been attempted yet.

Hope that helps.
Richard

:*test*
Executing task ':test' (up-to-date check took 0.054 secs) due to:
 No history is available.
Starting process 'Gradle Worker 1'. Working directory: 
/var/lib/jenkins/workspace/JFXtras8.0 Command: 
/usr/lib/jvm/jdk1.8.0-ea/bin/java 
-Djava.security.manager=jarjar.org.gradle.process.internal.child.BootstrapSecurityManager
 -Dfile.encoding=UTF-8 -ea -cp 
/var/lib/jenkins/.gradle/caches/1.9/workerMain/gradle-worker.jar 
jarjar.org.gradle.process.internal.launcher.GradleWorkerMain
Successfully started process 'Gradle Worker 1'
Gradle Worker 1 executing tests.

jfxtras.labs.scene.control.test.ListSpinnerEditableTest > 
enterSelectValueByTyping STANDARD_ERROR
   Graphics Device initialization failed for :  es2, sw
   Error initializing QuantumRenderer: no suitable pipeline found
   java.lang.RuntimeException: java.lang.RuntimeException: Error initializing 
QuantumRenderer: no suitable pipeline found
        at 
com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:300)
        at 
com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:244)
        at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:179)
        at 
com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:210)
        at 
com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:653)
        at 
com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
        at 
com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:56)
        at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:158)
        at java.lang.Thread.run(Thread.java:744)
   Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: 
no suitable pipeline found
        at 
com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:98)
        at 
com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:128)
        ... 1 more
   Exception in thread "Thread-4" java.lang.RuntimeException: No toolkit found
        at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:191)
        at 
com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:210)
        at 
com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:653)
        at 
com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
        at 
com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:56)
        at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:158)
        at java.lang.Thread.run(Thread.java:744)



Reply via email to