On Wed, 2 Apr 2025 19:32:32 GMT, Phil Race <p...@openjdk.org> wrote:

>> test/jdk/javax/swing/text/BoxView/BaselineTest.java line 119:
>> 
>>> 117: }
>>> 118: 
>>> 119: class PaintLabel extends JLabel {
>> 
>> Could you please move all the supporting classes `PaintLabel`, 
>> `CustomComponentView`, `CustomEditorKit` into the main test class 
>> `BaselineTest` as static nested classes.
>> 
>> This greatly simplifies working with test in IDE, there'll be no duplicate 
>> classes.
>
> I guess I can but I don't know where you are seeing duplicate classes.

Now that we use a flat layout for tests, marking a folder as a *test source* 
folder may result in duplicate classes if any of the tests in the current 
folder or another test source folder with tests has classes with the same name. 
It makes running tests from IDE impossible because the test classes fail to 
compile.

This issue often occurs with `Sysout` standard test machinery (that we're 
slowly getting rid of by replacing with `PassFailJFrame`) and other cases…

The chance of getting such conflicts / duplicate class names is significantly 
reduced if all the supporting classes are nested inside the main test class.

>> test/jdk/javax/swing/text/html/FormView/4473401/bug4473401.java line 76:
>> 
>>> 74:     public void hyperlinkUpdate(HyperlinkEvent e) {
>>> 75:         if (e instanceof FormSubmitEvent) {
>>> 76:             jep.setText("If you see this page the test<font 
>>> color=green> PASSED</font></CENTER>");
>> 
>> Does it mean, the test is semi-automatic, and you can call 
>> `PassFailJFrame.forcePass()` in this case?
>
> I don't think so. The sequence is the user presses the buttom, the event is 
> received here which calls an API to set text and then the user has to 
> visually verify that the text was displayed.

Yeah, makes sense.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24364#discussion_r2026835526
PR Review Comment: https://git.openjdk.org/jdk/pull/24364#discussion_r2026839497

Reply via email to