#### Requirement:
We want to be able to test a JavaFX SDK built somewhere else other than on 
current machine or current repo on same machine. Which means we should be able 
to run the unit and system tests with a different JavaFX SDK.

#### Change:
##### Run tests using a specified JavaFX SDK:
- Introduce a property `TEST_JAVAFX_SDK_PATH` that points to the JavaFX SDK 
which was built elsewhere.
- Modify the paths generated by build.gradle to point to the path sepcified by 
`TEST_JAVAFX_SDK_PATH`
- When a `TEST_JAVAFX_SDK_PATH` is specified `-PTEST_ONLY=true` must also be 
specified.

##### Generate the JavaFX SDK bundle
- Generate the minimal JavaFX SDK bundle that is required to run the tests: We 
require content of the _build/sdk_ and _build/shims_ directories to achieve the 
same.


#### Verification:
##### With a single machine:
1. Create two local copies JavaFX repo, [repo1, repo2]
2. Build sdk and shims in repo1. `gradle sdk shims`
3. In repo2, run different tests as,
> gradle -PTEST_ONLY=true -PTEST_JAVAFX_SDK_PATH=**repo1/build**  :base:test 
> <any tests>
4. In repo1 run `gradle all`
5. `javafx-sdk-shims.zip` file would be created under repo1/build. unzip it any 
`unzip-path` on machine
6. In repo2, run the tests by providing the `unzip-path` as TEST_JAVAFX_SDK_PATH
> gradle -PTEST_ONLY=true -PTEST_JAVAFX_SDK_PATH=**unzip-path**  :base:test 
> <any tests>

##### With 2 machines.
1. Run `gradle all` on a machine1
2. Move build/javafx-sdk-shims.zip to machine2 and unzip to any `unzip-path`
3. Run the tests by providing the `unzip-path` as TEST_JAVAFX_SDK_PATH
> gradle -PTEST_ONLY=true -PTEST_JAVAFX_SDK_PATH=**unzip-path**  :base:test 
> <any tests>


#### Additional changes:
Additionally we observed that three unit tests failed because they access a 
specific path. A path that would no exists when JavaFX SDK is not built.
1. Controls test: test.javafx.scene.control.ControlTest.testRT18097
It required path: 
modules/javafx.controls/build/classes/java/main/javafx.controls/javafx
It is fixed by change on line 2811

2. Graphics test: test.javafx.css.CssMetaDataTest.testRT18097
It required path: 
modules/javafx.graphics/build/classes/java/main/javafx.graphics/javafx
It is fixed by change on line 2722

3. Base test: test.com.sun.javafx.runtime.VersionInfoTest
It required path: build/module-lib/javafx.properties
VersionInfoTest is specific to the local build of JavaFX. So, It can be safely 
excluded when TEST_JAVAFX_SDK_PATH is specified.
It is fixed by change on line 2304 to 2310

-------------

Commit messages:
 - TEST_JAVAFX_SDK_PATH and create sdk-shims-bundle

Changes: https://git.openjdk.org/jfx/pull/1577/files
  Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=1577&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8297072
  Stats: 61 lines in 1 file changed: 53 ins; 0 del; 8 mod
  Patch: https://git.openjdk.org/jfx/pull/1577.diff
  Fetch: git fetch https://git.openjdk.org/jfx.git pull/1577/head:pull/1577

PR: https://git.openjdk.org/jfx/pull/1577

Reply via email to