Testing classes in com.sun hierarchy, IllegalAccessError in graphics but not base?
John Hendrikx
john.hendrikx at gmail.com
Sun Apr 23 16:36:48 UTC 2023
Never mind, I think I found it now...
There exist "addExports" files for various purposes, including tests.
The export I needed was missing in
"./modules/javafx.graphics/src/test/addExports".
--John
On 23/04/2023 18:19, John Hendrikx wrote:
> Hi list,
>
> I stumbled upon an odd issue; when I look at the Gradle output when
> running tests for graphics, it has many lines like this:
>
> --add-exports
> javafx.graphics/com.sun.javafx.scene.layout.region=ALL-UNNAMED
>
> Basically one for every package in the com.sun hierarchy, or so I
> thought...
>
> However, my test is located in "com.sun.javafx.scene.layout", and for
> some reason it is not adding this line to the test build command.
> This is resulting in an IllegalAccessError during building:
>
> java.lang.IllegalAccessError: class
> test.com.sun.javafx.scene.layout.SpaceDistributorTest (in unnamed
> module @0x20d28811) cannot access class
> com.sun.javafx.scene.layout.SpaceDistributor (in module
> javafx.graphics) because module javafx.graphics does not export
> com.sun.javafx.scene.layout to unnamed module @0x20d28811
>
> I've been digging through build.gradle for the past hour, and can't
> really find what is controlling this. There is another test in this
> package (RegionTest) but for some reason everything in it is commented
> out except "@Test public void dummy() {}".
>
> --John
>
More information about the openjfx-dev
mailing list