running systemtests in isolated java processes
Johan Vos
johan.vos at gluonhq.com
Fri Mar 1 16:43:11 UTC 2024
On Fri, Mar 1, 2024 at 4:04 PM Kevin Rushforth <kevin.rushforth at oracle.com>
wrote:
> Hi Johan,
>
> FOr the systemTests project, the gradle test runner does run each test
> class in its own VM, as a result of the "forkEvery = 1" setting. As
> noted, gradle launches tests using a gradle test runner class as the
> main method, but there is still a 1 VM to 1 test class relationship.
>
Yes, but the main class is not the class extending from Application, which
makes a difference for sun.launcher.LauncherHelper
> We have a few tests that specifically test launching JavaFX
> applications, including testing classes that extend Application (with
> and without a main method), such as the ones in test.launchertest, but
> they do it by exec-ing a new Java process. Would that work for what you
> want to do?
>
That looks indeed exactly what I want. Thanks for the pointer, I'll have a
look!
Perhaps tangentially related to this, I spent some time a while ago
> looking at what it would take to use jtreg to run our tests. I was
> looking at jtreg's ability to run JUnit tests, but there is also a mode
> of jtreg to run standalone main program tests. That could provide a way
> to run test applications directly, although likely only for tests
> written with that in mind.
>
Sounds interesting.
> -- Kevin
>
>
> On 3/1/2024 6:18 AM, Johan Vos wrote:
> > Hi,
> >
> > We currently run systemtests using a gradle command, but that doesn't
> > start a clean Java process for the individual tests (which would be
> > very convenient as that allows us to inspect the process with VisualVM).
> > We know the behavior of a JavaFX application can be different depending
> if
> > 1. the mainClass is the class extending from Application
> > 2. the mainClass is a wrapper class from e.g. Gradle or Maven.
> >
> > For system tests, I think it would be real handy to run them using the
> > first option, but I am not aware of an easy solution to make that work
> > with the current gradle setup. Or am I missing something obvious?
> >
> > Thanks,
> >
> > - Johan
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20240301/8d089727/attachment.htm>
More information about the openjfx-dev
mailing list