Skip to main content



      Home
Home » Eclipse Projects » e(fx)clipse » Junit Test fails for JavaFX nodes
Junit Test fails for JavaFX nodes [message #1737890] Wed, 13 July 2016 15:14 Go to next message
Eclipse UserFriend
Why do JavaFX classes throw java.lang.ExceptionInInitializerError in a JUnit test?

I'm currently working with an e4 project that uses JavaFX plug-ins. Recently I started creating Junit tests for the plugins with fragment projects. I was able to run a test that imports a controller class after adding "-Dorg.osgi.framework.bundle.parent=ext" to the VM-Arguments.

However, when I try to use javafx.scene.control classes (Button, Label, etc.) in the test, a java.lang.ExceptionInInitializerError is thrown when I run a JUnit/JUnit Plug-in Test. From what I read, ExceptionInInitializerErrors are thrown something goes wrong when initializing a static variable or function. But simply calling

new Button("Test");
throws the error.

Is there anything I need to add to the VM Arguments or fragment project Manifest?

Thank you.
Re: Junit Test fails for JavaFX nodes [message #1737892 is a reply to message #1737890] Wed, 13 July 2016 15:43 Go to previous message
Eclipse UserFriend
For those JavaFX Nodes JavaFx has to be bootstrapped, which is done by the e4 framework- it's on my todo list to make TestFX support available but that needs to be shipped from outside Eclipse because of liscensing issues
Previous Topic:How to create and run JUnit tests on FX plugins?
Next Topic:Problems exporting a Plugin
Goto Forum:
  


Current Time: Tue Jul 15 07:51:06 EDT 2025

Powered by FUDForum. Page generated in 0.04578 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top