Question ad running the "systemTests" module tests ...

Rony G. Flatscher Rony.Flatscher at
Thu Feb 20 15:08:55 UTC 2020

Hi Kevin,

On 20.02.2020 14:03, Kevin Rushforth wrote:
> None of the apps underneath testapp* are "tests", but are rather auxiliary applications that are
> run as apps in a separate process by a test. The test itself must be somewhere under
> tests/system/src/test/java.
> For example, the test class ModuleLauncherTest is in tests/system/src/test/java/test/launchertest.
> You probably need to do something similar.

thanks to your information I was able to succeed!

The new modular app needs to be added to
"tests/system/src/test/java/test/launchertest/". To do so, one needs (in this
example the modular app is "testapp7" which includes a package named "myapp7" which contains the
test "FXMLScriptTest" class):

  * to add (copy and adjust) a private field (a String) in this case named "modulePath7" which value
    gets fetched from a System property "launchertest.testapp7.module.path" which gets used in the
    test method that needs to be added as well (see next item)

  * then at the end add a new Test method:

    @Test (timeout = 15000)
    private void testModuleFXMLScriptTest() throws Exception {
       doTestLaunchModule(modulePath7, "myapp7.FXMLScriptTest");

To run the modular tests only, one can issue therefore:

    ./gradlew  -PFULL_TEST=true :systemTests:test --tests ModuleLauncherTest


> On 2/20/2020 1:31 AM, Rony G. Flatscher wrote:
>> Kevin,
>> thank you very much for your information!
>> On 19.02.2020 20:44, Kevin Rushforth wrote:
>>> First, make sure that your test class name ends with exactly the string "Test".
>> Renamed the class such that it ends in "Test" ("FXMLScriptTest"), however this does not cause the
>> class to be loaded from the modular app and its main() method to be run using "./gradlew
>> -PFULL_TEST=true :systemTests:test".
>> All the "systemTests" modular applications (cf. "jfx/tests/system/src/testapp{1..6}") do not contain
>> any classes that end in the string "Test"! Rather all the classes that carry out assertions possess
>> a main() method that controls the execution and the assertions (usually they extend Application and
>> implement the start() method, in which the test methods get triggered).
>> So that led me to believe that in the case of these system tests the test runner inspects all
>> classes and if they contain a main() method just executes it and upon return the launcher inspects
>> the return code to determine whether the system test run of that class was successful or not.
>> When trying to run test classes individually in the system tests, the "--tests" filter comes up with
>> an error, e.g. for
>>     ./gradlew -PFULL_TEST=true :systemTests:test --tests FXMLScriptTest
>> or for any other of the already existing system tests, e.g.:
>>     ./gradlew -PFULL_TEST=true :systemTests:test --tests AppFXMLOpened
>> [The above system test class "AppFXMLOpened" is part of the "testapp6" modular test and located in
>> the package "myapp6". Note, the class name does not end in "Test".]
>> So maybe there is another way to run/launch these system test modular apps (maybe also
>> individually)?
>> ---rony

More information about the openjfx-dev mailing list