[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    Re: RFR: 8297489: Modify TextAreaTextEventTest.java as to verify the content change of TextComponent
From:       Alexey Ivanov <aivanov () openjdk ! org>
Date:       2022-11-30 17:30:42
Message-ID: x74znMlKgJWlYLGvzcN3T5tXumF-r0xqfonljQySJ1s=.c13e552f-c34c-47b4-ac9d-fae16a4ffca1 () github ! com
[Download RAW message or body]

On Wed, 30 Nov 2022 16:38:48 GMT, ravi gupta <duke@openjdk.org> wrote:

> > Modify TextAreaTextEventTest.java as to verify the content changes of a both \
> > TextComponent(TextField,TextArea) for the following assertions. 
> > a. TextListener get invoked when the content of a TextField gets changed.
> > b. TextListener not get invoked during text selection or when Special keys such \
> > as Function Keys are pressed. 
> > 
> > Testing:
> > Tested using Mach5(20 times per platform) in macos,linux and windows and got all \
> > pass.
> 
> ravi gupta has updated the pull request incrementally with one additional commit \
> since the last revision: 
> Modified TextAreaTextEventTest.java as to verify the content change of \
> TextComponent sends TextEvent

Changes requested by aivanov (Reviewer).

test/jdk/java/awt/event/ComponentEvent/TextComponentTextEventTest.java line 63:

> 61:         TextArea textArea = new TextArea(5, 15);
> 62:         textArea.addTextListener((event) -> {
> 63:             System.out.println("TextArea Got a text event: " + event);

Nit for being consistent:
Suggestion:

            System.out.println("TextArea got a text event: " + event);

test/jdk/java/awt/event/ComponentEvent/TextComponentTextEventTest.java line 88:

> 86:                 EventQueue.invokeAndWait(() -> {
> 87:                     textFieldAt = textComp.getLocationOnScreen();
> 88:                     textFieldSize = textComp.getSize();

Suggestion:

                    textCompAt = textComp.getLocationOnScreen();
                    textCompSize = textComp.getSize();

This makes it clearer that the location and size are of a generic component which \
could be either `textField` or `textArea`.

test/jdk/java/awt/event/ComponentEvent/TextComponentTextEventTest.java line 116:

> 114:                     throw new RuntimeException(
> 115:                         "FAIL: TextEvent triggered when Enter pressed on in "
> 116:                             + textComp);

Suggestion:

                        "FAIL: TextEvent triggered when Enter pressed on "
                            + textComp);

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

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic