-
Bug
-
Resolution: Unresolved
-
P3
-
jfx15
Two of the FXML unit tests use the Nashorn JavaScript engine to test the FXML scripting capability. Nashorn has been deprecated since JDK 11 and has been removed in JDK 15.
When these tests are run with the default JDK 14, they pass, but produce a warning:
test.javafx.fxml.FXMLLoader_ScriptTest > testScriptHandler STANDARD_ERROR
Warning: Nashorn engine is planned to be removed from a future JDK release
test.javafx.fxml.FXMLLoader_ScriptTest > testExternalScriptHandler STANDARD_ERROR
Warning: Nashorn engine is planned to be removed from a future JDK release
When running with JDK 15-ea these two tests fail (as expected, since Nashorn is gone).
test.javafx.fxml.FXMLLoader_ScriptTest > testScriptHandler FAILED
javafx.fxml.LoadException: Page language not specified.
/C:/Users/kcr/javafx/jfx-kcr/jfx/rt/modules/javafx.fxml/build/resources/test/test/javafx/fxml/script_handler.fxml:35
at javafx.fxml/javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2625)
at javafx.fxml/javafx.fxml.FXMLLoader$ScriptElement.processCharacters(FXMLLoader.java:1604)
at javafx.fxml/javafx.fxml.FXMLLoader.processCharacters(FXMLLoader.java:2855)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2566)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2470)
at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:2439)
at test.javafx.fxml.FXMLLoader_ScriptTest.testScriptHandler(FXMLLoader_ScriptTest.java:134)
test.javafx.fxml.FXMLLoader_ScriptTest > testExternalScriptHandler FAILED
javafx.fxml.LoadException: Unable to locate scripting engine for extension js.
/C:/Users/kcr/javafx/jfx-kcr/jfx/rt/modules/javafx.fxml/build/resources/test/test/javafx/fxml/script_handler_external.fxml:31
at javafx.fxml/javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2625)
at javafx.fxml/javafx.fxml.FXMLLoader$ScriptElement.processStartElement(FXMLLoader.java:1544)
at javafx.fxml/javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2726)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2556)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2470)
at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:2439)
at test.javafx.fxml.FXMLLoader_ScriptTest.testExternalScriptHandler(FXMLLoader_ScriptTest.java:147)
We should remove these two tests and replace them with a different (custom) javax.script implementation. See the tests added forJDK-8234959 for an example of how this might be done.
When these tests are run with the default JDK 14, they pass, but produce a warning:
test.javafx.fxml.FXMLLoader_ScriptTest > testScriptHandler STANDARD_ERROR
Warning: Nashorn engine is planned to be removed from a future JDK release
test.javafx.fxml.FXMLLoader_ScriptTest > testExternalScriptHandler STANDARD_ERROR
Warning: Nashorn engine is planned to be removed from a future JDK release
When running with JDK 15-ea these two tests fail (as expected, since Nashorn is gone).
test.javafx.fxml.FXMLLoader_ScriptTest > testScriptHandler FAILED
javafx.fxml.LoadException: Page language not specified.
/C:/Users/kcr/javafx/jfx-kcr/jfx/rt/modules/javafx.fxml/build/resources/test/test/javafx/fxml/script_handler.fxml:35
at javafx.fxml/javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2625)
at javafx.fxml/javafx.fxml.FXMLLoader$ScriptElement.processCharacters(FXMLLoader.java:1604)
at javafx.fxml/javafx.fxml.FXMLLoader.processCharacters(FXMLLoader.java:2855)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2566)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2470)
at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:2439)
at test.javafx.fxml.FXMLLoader_ScriptTest.testScriptHandler(FXMLLoader_ScriptTest.java:134)
test.javafx.fxml.FXMLLoader_ScriptTest > testExternalScriptHandler FAILED
javafx.fxml.LoadException: Unable to locate scripting engine for extension js.
/C:/Users/kcr/javafx/jfx-kcr/jfx/rt/modules/javafx.fxml/build/resources/test/test/javafx/fxml/script_handler_external.fxml:31
at javafx.fxml/javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2625)
at javafx.fxml/javafx.fxml.FXMLLoader$ScriptElement.processStartElement(FXMLLoader.java:1544)
at javafx.fxml/javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2726)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2556)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2470)
at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:2439)
at test.javafx.fxml.FXMLLoader_ScriptTest.testExternalScriptHandler(FXMLLoader_ScriptTest.java:147)
We should remove these two tests and replace them with a different (custom) javax.script implementation. See the tests added for
- relates to
-
JDK-8241749 Remove the Nashorn JavaScript Engine
- Resolved
-
JDK-8248551 [TestBug] Ignore two failing FXML unit tests which use Nashorn script engine
- Resolved
-
JDK-8234959 FXMLLoader does not populate ENGINE_SCOPE Bindings with FILENAME and ARGV
- Resolved
-
JDK-8245183 Two fxml unit tests log warnings about deprecated escape sequences
- Resolved