RFR: 8316388: Opensource five Swing component related regression tests
Alexander Zuev
kizune at openjdk.org
Tue Mar 12 09:05:17 UTC 2024
On Mon, 11 Mar 2024 13:51:47 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:
>> Clean up five more tests.
>>
>> test/jdk/javax/swing/JDesktopPane/4132993/bug4132993.java
>> test/jdk/javax/swing/JDesktopPane/4773378/bug4773378.java
>> test/jdk/javax/swing/JEditorPane/4325606/bug4325606.java
>> test/jdk/javax/swing/JEditorPane/4330998/bug4330998.java
>> test/jdk/javax/swing/JEditorPane/4694598/FrameContent.html
>> test/jdk/javax/swing/JEditorPane/4694598/bug4694598.java
>
> test/jdk/javax/swing/JDesktopPane/4773378/bug4773378.java line 69:
>
>> 67: keyTyped = true;
>> 68: bug4773378.this.notifyAll();
>> 69: }
>
> A `CountDownLatch` would work great in this case.
>
> And `keyTyped` is a confusing name for a flag which gets to `true` when the internal frame is activated.
Renamed as frameActivated
> test/jdk/javax/swing/JDesktopPane/4773378/bug4773378.java line 85:
>
>> 83: public void performTest() {
>> 84: try {
>> 85: jif.setSelected(true);
>
> This should be called via `SwingUtilities.invokeLater` on EDT.
Fixed
> test/jdk/javax/swing/JDesktopPane/4773378/bug4773378.java line 102:
>
>> 100: } catch (Throwable t) {
>> 101: t.printStackTrace();
>> 102: }
>
> A `Throwable` should fail the test, it must be propagated.
Fixed.
> test/jdk/javax/swing/JEditorPane/4694598/FrameContent.html line 1:
>
>> 1: <HTML><BODY>
>
> Can this file be created by the test on the fly? There's no need for a supporting file.
>
> In #18147, Prasanta handled the same situation.
I prefer to keep things simpler and not to create an additional possible point of failure. The supporting html file is self-explanatory and, if needed, can be changed outside of fixing the test itself.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18184#discussion_r1521088031
PR Review Comment: https://git.openjdk.org/jdk/pull/18184#discussion_r1521088346
PR Review Comment: https://git.openjdk.org/jdk/pull/18184#discussion_r1521088621
PR Review Comment: https://git.openjdk.org/jdk/pull/18184#discussion_r1521092628
More information about the client-libs-dev
mailing list