Integrated: 8193543: Regression automated test '/open/test/jdk/java/awt/TrayIcon/SystemTrayInstance/SystemTrayInstanceTest.java' fails

Alexander Zvegintsev azvegint at openjdk.java.net
Sat Apr 23 20:45:36 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.

This pull request has now been integrated.

Changeset: 08024d95
Author:    Alexander Zvegintsev <azvegint at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/08024d9583d02398d986db0e9b32fe19a2b8fec2
Stats:     29 lines in 2 files changed: 14 ins; 2 del; 13 mod

8193543: Regression automated test '/open/test/jdk/java/awt/TrayIcon/SystemTrayInstance/SystemTrayInstanceTest.java' fails

Reviewed-by: serb

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

PR: https://git.openjdk.java.net/jdk/pull/8346



More information about the client-libs-dev mailing list