Integrated: JDK-8340210 : Add positionTestUI() to PassFailJFrame.Builder

Harshitha Onkar honkar at openjdk.org
Tue Sep 17 20:08:10 UTC 2024


On Mon, 16 Sep 2024 19:11:59 GMT, Harshitha Onkar <honkar at openjdk.org> wrote:

> `positionTestUI()` option is added to PassFailJFrame (PFJ).
> 
> With this change multiple UI can be positioned using the PFJ new builder pattern by providing implementation for the Functional Interface `PositionWindows.positionTestWindows(List<? extends Window> testWindows,InstructionUI instructionUI)` in the test code. 
> 
> Since the position implementation is done in test code it allows flexibility as the user can add custom positioning code as per test UI requirements.
> 
> Usage:
> 
> PassFailJFrame.builder()
>                       .title("Test Instructions")
>                       .instructions(INSTRUCTIONS)
>                       .rows(int)
>                       .columns(int)
>                       .testUI(<TestClass::createAndShowUI>)
>                       .positionTestUI(<TestClass::positionMultiTestUI>)
>                       .build()
>                       .awaitAndCheck();
> 
> where positionMultiTestUI is the implementation for positioning of multiple test windows for `PositionWindows.positionTestWindows(List<? extends Window> testWindows,InstructionUI instructionUI)`
> 
> @aivanov-jdk has demonstrated custom test UI positioning in this PR: 
> **[8294156: Demo positioning of multiple test windows](https://github.com/openjdk/jdk/pull/15721)**

This pull request has now been integrated.

Changeset: f0ae90f3
Author:    Harshitha Onkar <honkar at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/f0ae90f30c346544e87217ef1832d6a350fe1985
Stats:     23 lines in 1 file changed: 23 ins; 0 del; 0 mod

8340210: Add positionTestUI() to PassFailJFrame.Builder

Co-authored-by: Alexey Ivanov <aivanov at openjdk.org>
Reviewed-by: aivanov, azvegint

-------------

PR: https://git.openjdk.org/jdk/pull/21023


More information about the client-libs-dev mailing list