RFR: 8367991: Update RegionBackground tests to use ScreenCaptureTestWatcher utility [v2]
Jayathirth D V
jdv at openjdk.org
Mon Sep 22 11:51:35 UTC 2025
On Fri, 19 Sep 2025 12:19:15 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:
> This approach requires each test to copy logic from the base class into the test class, so it will be harder to maintain and doesn't scale well.
>
> My recommendation is to either:
>
> 1. Make the changes to move the hiding of the changes to the base class methods, change all subclasses that currently have a different `@BeforeEach` method _not_named `doSetup` to rename their `@BeforeEach` method to `doSetup()` and call `super.doSetup()` as the first statement of the overridden method
>
> 2. Create a protected utility method in VisualTestBase that a subclass can call.
>
>
> I think 1 might be better, since it keeps all of the logic in the base class, but 2 would be OK as well, since the actual cleaning of the stages would remain in the base class, but it does require overriding the two methods.
I have followed the 1st recommendation and updated to include main change in base class and now all sub-classes override the base class setup functions with same name. I have checked all classes which inherit from VisualTestBase and updated them.
Also PointLightIlluminationTest maintains first created stage and uses it for all consecutive tests, so added flag in base class to make sure we re-use the stage. CI headful test run with latest update is green.
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1913#issuecomment-3318499367
More information about the openjfx-dev
mailing list