问题描述
我想针对Java 7u6与集成的JavaFX 2.2运行一个JavaFX 2应用程序自动化测试。
为此,我已经构建并集成并的到我的构建环境。
一个简单的烟雾测试运行在所有相关操作系统。
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.
作为下一个步骤,我想作为连续部署过程的一部分运行测试。
因为这不是正式的JavaFX支持openSUSE上,目前的CI服务器运行,
我已经建立了一个虚拟机,并安装GTK2 Ubuntu的服务器安装。结果
为了弥补缺乏一个完全成熟的窗口系统中,我曾尝试运行测试两个的Xvnc 和的Xvfb 的,但无济于事。
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.
在的Xvnc 的,测试失败,
Prism ES2 Error - nInitialize: glXChooseFBConfig failed
而在的Xvfb 的,他们给我
Xlib: extension "RANDR" missing on display ":10".
A blog帖子建议安装 GTK的发动机-pixbuf的
来缓解第二个问题,但这只是改变了错误信息的显示数量。
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.
现在,我召唤计算器的JavaFX的知识,并要求
Now, I summon the JavaFX knowledge of StackOverflow and ask
- 你知道如何解决上述的错误?
- 你有没有成功运行(无头)CI服务器上的一个JavaFX 2测试或机器人互动?
- 您是如何配置系统,以得到它的工作?
推荐答案
有关的JavaFX(无头)CI服务器测试的支持是不可用,直到8 JavaFX的
Support for (headless) CI server testing of JavaFX is not available until JavaFX 8.
根据这些JavaFX的问题跟踪记录的信息答:
Answer based on information in these JavaFX issue tracking records:
- 无头玻璃工具需要连接到昆腾和棱镜单元测试
- 量子需要无头和headful测试)。
- JDK-8088651 "Headless Glass toolkit needs to be connected to Quantum and Prism unit tests"
- JDK-8091286 "Quantum needs headless and headful tests").
更新2015年1月8日
链接的JavaFX的问题跟踪记录未实现的Java 8和已被重新分配到Java 9。
The linked JavaFX issue tracking records were not implemented for Java 8 and have been reassigned to Java 9.
Java的源8 code目前包括Monocle杂志命名为一个最小的渲染引擎,它提供了JavaFX组件无头渲染(渲染和其他各种目标平台)。我从来没有使用单片眼镜并不能提供有关如何使用它的无头渲染的详细说明。我相信,使用单片眼镜,你现在需要从源头进行的JavaFX的定制版本(因为我认为单片眼镜通常只在嵌入式的JavaFX版本出货,这是不标准的JavaFX版本附带的桌面Java运行时和JDK环境) 。
Java 8 source code currently includes a minimal rendering engine named Monocle which provides Headless rendering (and rendering for various other target platforms) for JavaFX components. I have never used Monocle and cannot provide detailed instructions on how to use it for headless rendering. I believe to use Monocle, you currently need to perform a custom build of JavaFX from source (as I think Monocle is usually only shipped in embedded JavaFX versions, which is not the standard JavaFX version which ships with the desktop Java runtime and JDK environments).
这是Monocle杂志的信息可在。
Information on Monocle is available on the JavaFX wiki.
虽然无头呈现由单片眼镜提供的,我不认为使用单片眼镜进行无头渲染正式Oracle支持(虽然我不认为任何形式的JavaFX的无头渲染正式支持,所以我想,如果单片眼镜很适合你,通过各种手段使用它)。
Although, headless rendering is provided by Monocle, I do not think that using Monocle to perform headless rendering is officially supported by Oracle (though i don't think headless rendering of JavaFX in any form is officially supported, so I guess if Monocle works well for you, by all means use it).
在单片眼镜无头渲染是一个软件渲染实施,使一些图形原语的执行可能比的JavaFX在桌面环境中的标准硬件加速运行速度较慢。
The headless rendering in Monocle is a software rendering implementation so execution of some graphic primitives may be slower than the standard hardware accelerated operation of JavaFX in a desktop environment.
有可能会允许的JavaFX来在我不知道的无头环境中运行的其他方法。
There may be other methods of allowing JavaFX to run in a headless environment that I am not aware of.
如果有疑问,请了JavaFX开发人员在
If in doubt, ask the JavaFX developers on the openjfx-dev mailing list.
如果你在Linux下运行,通过Xvfb由Jan Zarnikov的回答的建议可能是一个很好的解决方案,并有可能preferable使用单片眼镜。
If you are running under Linux, using Xvfb as suggested by Jan Zarnikov's answer is probably a good solution and is likely preferable to using Monocle.
这篇关于如何在无头环境中测试JavaFX的2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!