JDK-8097417 : Create regression tests that run JavaFX apps with a security manager
  • Type: Bug
  • Component: javafx
  • Sub-Component: other
  • Affected Version: 8u20
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-03-12
  • Updated: 2015-10-09
  • Resolved: 2014-03-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8u20Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8097534 :  
Description
There are several areas in JavaFX that are prone to regressions when running with a security manager. Specifically, startup (both standard FX apps and Swing interop apps), WebView, CSS, and FXML.

See RT-36141 and RT-36189 for two examples that were introduced several months before code freeze for FX 8, but only recently discovered. This reveals a serious hole in our testing.

We need at least two regression tests to cover this: a standard FX app and a Swing app using JFXPanel. Both tests should load the same content in the FX Scene, using WebView, FXML, and CSS. The tests should run with jfxrt.jar loaded by the extension classloader, by specifying "-Djava.ext.dirs" as a JVM arg.
Comments
Unit Test: tests/system/src/test/java/sandbox/SandboxAppTest.java
19-03-2014

This regression test also will catch the bug described in RT-35584.
19-03-2014

http://hg.openjdk.java.net/openjfx/8u-dev/rt/rev/9604915644c1
18-03-2014

For completeness, here is the delta patch between the final (v2 version) that I will shortly push and the v1 version above: http://cr.openjdk.java.net/~kcr/RT-36197-delta-v2-v1/
18-03-2014

I cleaned, purged and updated my repo and now I get 100% test pass with the patch. +1.
18-03-2014

I filed https://bugs.openjdk.java.net/browse/JDK-8037776 to track the JDK bug on Mac.
18-03-2014

Update on the hang of JFXPanelImplicitExitApp on Mac: This is a Swing bug in the JDK which I can reproduce with a simple Swing-only program (no JavaFX at all). It looks like something in Swing in deadlocking when a security manager is present. I will file a JDK bug shortly (and disable the JFXPanelImplicitExitApp test when running on Mac).
18-03-2014

Chien: thanks for the info; good to know that sandbox/SandboxAppTest runs fine for you (note that sandbox/app/FXApp is not a unit test, it's an app started by the SandboxAppTest -- only classes that end in "Test" are unit tests). I'll sync up with you later today about the unrelated full test failures. Felipe: did your clean rebuild work OK?
18-03-2014

Me too I'm unable to get a successful test run with a cleanly build repo. The full test fails with 92% pass rate. I'm able to get 100% if I do a single test for sandbox/SandboxAppTest, but not with sandbox/app/FXApp.
18-03-2014

Tests are not happy for me (not only the new ones, but old tests too), I'll make sure my build is good and try again.
17-03-2014

@Anthony: Thanks for the pointer. I think I'm hitting a different bug, since my stack trace doesn't look like that one (although the root cause could be similar). In my case everything looks idle except there is still a non-daemon worker thread, possibly associated with the Swing timer, that is waiting for something. I'm not near my Mac at the moment, so I'll post the stack trace tomorrow when I file the bug.
17-03-2014

gradle -PFULL_TEST=true test Or if you just want to run just the one test itself: gradle -Dtest.single=sandbox/SandboxAppTest -PFULL_TEST=true :systemTests:test [NOTE: the closed tests also run whenever :systemTests:test is run...I am going to separate them from :systemTests in a follow-on JIRA because the one should not depend on the other).
17-03-2014

What is the command line to run these new tests ?
17-03-2014

Kevin: RT-31124 seems to cover the Mac issue with JFXPanel.
17-03-2014

On my Mac (which I hadn't tested before now) the JFXPanelImplicitExitApp fails with a timeout. I suspect this is a real issue with JFXPanel apps on Mac, so I will file a bug, and disable that particular test on Mac for now.
17-03-2014

I also noticed a "TODO:" comment that I forgot to take care of, so I will do that as well. Ditto a left-over comment block or two.
17-03-2014

Please review the following fix: http://cr.openjdk.java.net/~kcr/RT-36197/ Reviewers: Chien, Felipe This is a new set of regression tests that run using a restrictive security manager to ensure that we don't introduce any more regressions of the kind mentioned above. They work in a similar manner to the launcher tests in that we launch a separate process for the app with a security manager enabled on the command line (it's easier to write the tests, plus gradle becomes very unhappy if you try to run tests with a security manager installed). I left in some debug print statements that I will remove before pushing, but I wanted them there for testing.
17-03-2014