RFR: 8193543: Regression automated test '/open/test/jdk/java/awt/TrayIcon/SystemTrayInstance/SystemTrayInstanceTest.java' fails
Sergey Bylokhov
serb at openjdk.java.net
Fri Apr 22 22:28:35 UTC 2022
On Thu, 21 Apr 2022 17:47:12 GMT, Alexander Zvegintsev <azvegint at openjdk.org> wrote:
> Looks like this test was written based on assumption that SystemTray is supported on all platforms.
>
> However on Linux it may not be true.
>
> Availability of SystemTray is detected by getting owner of `_NET_SYSTEM_TRAY` selection:
>
> https://github.com/openjdk/jdk/blob/739769c8fc4b496f08a92225a12d07414537b6c0/src/java.desktop/unix/classes/sun/awt/X11/XSystemTrayPeer.java#L42
>
> https://github.com/openjdk/jdk/blob/739769c8fc4b496f08a92225a12d07414537b6c0/src/java.desktop/unix/classes/sun/awt/X11/XSystemTrayPeer.java#L58-L59
>
>
> As an example, SystemTray is not available on Wayland because of this.
>
>
>
> So I modified the test:
>
> - WIndows and macOS: expecting available SystemTray.
> - Linux: check absence/presence of `UnsupportedOperationException` exception of `SystemTray.getSystemTray()` call based on `SystemTray.isSupported()` result.
>
> Testing is green on all platforms.
Marked as reviewed by serb (Reviewer).
-------------
PR: https://git.openjdk.java.net/jdk/pull/8346
More information about the client-libs-dev
mailing list