RFR: JDK-8290469: Add new positioning options to PassFailJFrame test framework [v4]
Harshitha Onkar
honkar at openjdk.org
Fri Jul 29 23:53:52 UTC 2022
On Fri, 29 Jul 2022 22:01:44 GMT, Phil Race <prr at openjdk.org> wrote:
>> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision:
>>
>> added screen insets to account for taskbar position, doc changes
>
> Well .. there surely must be test scenarios where a Frame is required. Perhaps the test moves it, iconifies, needs
> a specific size .. expects focus to move in a certain order between components in the frame .. wants to use
> heavyweight AWT components .. .in some of these I expect the extra instruction part doesn't matter but you only have to find ONE case where it matters .. then there's the fact you'd have to rewrite all the existing tests. And why a JSplitPane, anyway ? Odd choice.
>
> I can imagine that it might be interesting to add a new version that works with a JPanel as the container for the test and let a test author decide if they want to use that for future tests.
@prrace I do see your point and the broader range of testing requirements that might need to be supported by the test framework in future such as iconifying/ minimizing test frames.
Earlier when I suggested JSplitPane, I was looking it from ease of positioning, disposing and that most of the manual tests had more or less - one instruction frame and one test window which could be achieved using the JSplitPane. I probably missed analyzing the part about broader support of framework for future test cases.
> Another approach would be to use a [JSplitPane](https://docs.oracle.com/javase/tutorial/uiswing/components/splitpane.html) to have the instruction frame and the main test frame as one window. Left half/top as instruction frame and Right half/ bottom as the main test window and this also provides HORIZONTAL_SPLIT or VERTICAL_SPLIT orientation equivalent to HORIZONTAL and VERTICAL positioning of PassFailJFrame.
>
> Advantage of this approach:
>
> * No need to manually position the instruction frame and then the test window, as it will be one window - JSplitPane
> * Entire window (test + instruction frame) need to be positioned only once.
> * With this change, we might no longer need positionTestWindow() method, additionally the framework code will be simple and straightforward.
-------------
PR: https://git.openjdk.org/jdk/pull/9525
More information about the client-libs-dev
mailing list