changeset 17417:a3a2e470b3a9

8014721: TEST_BUG: java/awt/TrayIcon/DragEventSource/DragEventSource.java fails with java.lang.UnsupportedOperationException Reviewed-by: anthony, serb
author kshefov
date Fri, 17 May 2013 14:08:59 +0400
parents 09124775a94b
children 8020a2430704
files jdk/test/java/awt/TrayIcon/DragEventSource/DragEventSource.java
diffstat 1 files changed, 18 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/test/java/awt/TrayIcon/DragEventSource/DragEventSource.java	Fri May 17 11:02:55 2013 +0400
+++ b/jdk/test/java/awt/TrayIcon/DragEventSource/DragEventSource.java	Fri May 17 14:08:59 2013 +0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -64,6 +64,21 @@
     }
 
     private static void init() {
+
+        boolean isSupported = SystemTray.isSupported();
+        System.out.println("is SysTray Supported: " + isSupported);
+
+        if (!isSupported) {
+            String[] instructions =
+            {
+              "The test cannot be run because SystemTray is not supported.",
+              "Simply press PASS button."
+            };
+            Sysout.createDialog( );
+            Sysout.printInstructions( instructions );
+            return;
+        }
+
         String[] instructions =
         {
             "Use see a Frame with a button in it.",
@@ -79,8 +94,8 @@
 
         frame.setLayout(new FlowLayout());
         tray = SystemTray.getSystemTray();
-        boolean isSupported = tray.isSupported();
-        System.out.println("is SysTray Supported: " + isSupported);
+
+
         TrayIcon icons[] = tray.getTrayIcons();
         System.out.println(icons.length);