<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 1, 2024 at 4:04 PM Kevin Rushforth <<a href="mailto:kevin.rushforth@oracle.com">kevin.rushforth@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Johan,<br>
<br>
FOr the systemTests project, the gradle test runner does run each test <br>
class in its own VM, as a result of the "forkEvery = 1" setting. As <br>
noted, gradle launches tests using a gradle test runner class as the <br>
main method, but there is still a 1 VM to 1 test class relationship.<br></blockquote><div><br></div><div>Yes, but the main class is not the class extending from Application, which makes a difference for sun.launcher.LauncherHelper</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
We have a few tests that specifically test launching JavaFX <br>
applications, including testing classes that extend Application (with <br>
and without a main method), such as the ones in test.launchertest, but <br>
they do it by exec-ing a new Java process. Would that work for what you <br>
want to do?<br></blockquote><div> </div><div>That looks indeed exactly what I want. Thanks for the pointer, I'll have a look!</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Perhaps tangentially related to this, I spent some time a while ago <br>
looking at what it would take to use jtreg to run our tests. I was <br>
looking at jtreg's ability to run JUnit tests, but there is also a mode <br>
of jtreg to run standalone main program tests. That could provide a way <br>
to run test applications directly, although likely only for tests <br>
written with that in mind.<br></blockquote><div><br></div><div>Sounds interesting. </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
-- Kevin<br>
<br>
<br>
On 3/1/2024 6:18 AM, Johan Vos wrote:<br>
> Hi,<br>
><br>
> We currently run systemtests using a gradle command, but that doesn't <br>
> start a clean Java process for the individual tests (which would be <br>
> very convenient as that allows us to inspect the process with VisualVM).<br>
> We know the behavior of a JavaFX application can be different depending if<br>
> 1. the mainClass is the class extending from Application<br>
> 2. the mainClass is a wrapper class from e.g. Gradle or Maven.<br>
><br>
> For system tests, I think it would be real handy to run them using the <br>
> first option, but I am not aware of an easy solution to make that work <br>
> with the current gradle setup. Or am I missing something obvious?<br>
><br>
> Thanks,<br>
><br>
> - Johan<br>
<br>
</blockquote></div></div>