Understanding OpenJFX Unit tests.
OpenJFX contains many JUnit based unit tests that can be run using 'gradle test' as part of a build. These are JUnit based tests.
Locations
There are two primary locations to find the unit tests in the repository:
...
A shim is a java class that provides a backdoor into the core classes for testing purposes.They are special in a number of ways:
- they use the same extension classloader as the core classes
- they provide test entry points that circumvent restrictions on API visibility for unit testing.
- they usually must live in the same package as the API they are exposing.
- they cannot use classes on the Application class loader - like the JUnit API (no import org.junit.* for example)
- with modules - they must live in a package referenced in the module-info for the class.
It is best to keep these classes as simple as possible, retaining as much of the test logic in the Unit test classes as possible. Sometimes, it makes sense to add more than just an accessor method, adding utility routines that may be easier to write from within the protected package.
In the OpenJFX repository, the shims are any test class that does not reside in the test package.
...
The following is an example command line that can run a junit test from within a built Linux OpenJFX modular tree:
(coming soon)