JDK-8198858 : Remove use of internal packages of core modules from unit tests
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: openjfx11
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-03-01
  • Updated: 2018-06-13
  • Resolved: 2018-03-13
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.
Other
openjfx11Fixed
Related Reports
Blocks :  
Description
The unit tests in the graphics and systemTests projects access a small number of internal packages. Note that there are also references to sun.util.logging by multiple tests (in multiple projects), but those will be removed as part of JDK-8195799.

The rest are as follows:

modules/javafx.graphics/src/test/addExports:--add-exports=java.desktop/sun.font=ALL-UNNAMED
modules/javafx.graphics/src/test/addExports:--add-exports=java.desktop/sun.awt=ALL-UNNAMED
modules/javafx.graphics/src/test/addExports:--add-exports=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED
tests/system/src/test/addExports:--add-exports=java.desktop/sun.awt=ALL-UNNAMED
Comments
Changeset: bfcdf46bbe23 Author: kcr Date: 2018-03-13 07:32 -0700 URL: http://hg.openjdk.java.net/openjfx/jfx-dev/rt/rev/bfcdf46bbe23 8198858: Remove use of internal packages of core modules from unit tests Reviewed-by: arapte
13-03-2018

Verified build and test execution on Windows7. Change looks good to me +1.
13-03-2018

Webrev: http://cr.openjdk.java.net/~kcr/8198858/webrev.00/ Implements the changes referred to above.
08-03-2018

1. sun.font usage was a mistake in the import statement. The test should be importing com.sun.javafx.font.CharToGlyphMapper and not sun.font.CharToGlyphMapper 2. com.sun.org.apache.xerces.internal.util is an unused import in one test 3. sun.awt is used in two tests (both of which are currently @Ignore'd for unrelated reasons) as follows: graphics: ServiceWithSecurityManagerTest -- extends AWTSecurityManager needlessly (can instead extend SecurityManager) systemTests: RT23603Test -- uses a nonpublic Toolkit method in an attempt to wait for idle. The fix is to replace with a sleep, which is what all other system tests do.
08-03-2018